Discussion:
Starting OneDrive
(too old to reply)
Anthony R. Gold
2020-04-17 00:29:58 UTC
Permalink
I'd like to make a batch file to restart OneDrive. This is my attempt:

Taskkill /IM OneDrive.exe /F
timeout 10
C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe

The first two lines execute fine but then the last give this error:

OneDrive can't be run using full administrator rights

Please restart OneDrive without administrator rights

Any pointers will be helpful.
Anthony R. Gold
2020-04-17 00:35:11 UTC
Permalink
On Thu, 16 Apr 2020 20:29:58 -0400, "Anthony R. Gold"
Post by Anthony R. Gold
Taskkill /IM OneDrive.exe /F
timeout 10
C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe
OneDrive can't be run using full administrator rights
Please restart OneDrive without administrator rights
Any pointers will be helpful.
Sorry - my mistake. The latest version of the failing batch is now:

Taskkill /IM OneDrive.exe /F
timeout 10
START /d "C:\Program Files (x86)\Microsoft OneDrive" OneDrive.exe /background"
JJ
2020-04-17 18:50:00 UTC
Permalink
Post by Anthony R. Gold
On Thu, 16 Apr 2020 20:29:58 -0400, "Anthony R. Gold"
Post by Anthony R. Gold
Taskkill /IM OneDrive.exe /F
timeout 10
C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe
OneDrive can't be run using full administrator rights
Please restart OneDrive without administrator rights
Any pointers will be helpful.
Taskkill /IM OneDrive.exe /F
timeout 10
START /d "C:\Program Files (x86)\Microsoft OneDrive" OneDrive.exe /background"
The /D must follow the starting directory of the program, so you'll need to
execute START as:

start /d {directory path} {file path [program options]}

Check the START command line usage. Type: start /?
Anthony R. Gold
2020-04-17 22:13:32 UTC
Permalink
Post by JJ
Post by Anthony R. Gold
START /d "C:\Program Files (x86)\Microsoft OneDrive" OneDrive.exe /background"
The /D must follow the starting directory of the program, so you'll need to
start /d {directory path} {file path [program options]}
Thanks but I can't detect difference(s). Maybe my poor eyesight. Could you
make it/them plainer to me?

And anyway, how could this be the cause of that error message:

OneDrive can't be run using full administrator rights

Please restart OneDrive without administrator rights
JJ
2020-04-18 11:28:39 UTC
Permalink
Post by Anthony R. Gold
Thanks but I can't detect difference(s). Maybe my poor eyesight. Could you
make it/them plainer to me?
Just use this. No need to use the START command.

"C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe" /background
Post by Anthony R. Gold
OneDrive can't be run using full administrator rights
Please restart OneDrive without administrator rights
Make sure the Command Prompt is not started using administrator (as
elevated).

To make thing simpler, create a new program shortcut which will restart
OneDrive. Specify below command line for the "Target" field in the shortcut
property dialog. Note: below line is a single line. It may be broken into
multiple lines by your usenet reader application.

cmd.exe /c taskkill onedrive.exe /f & timeout 10 & "C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe" /background"
Anthony R. Gold
2020-04-18 13:49:10 UTC
Permalink
Post by JJ
To make thing simpler, create a new program shortcut which will restart
OneDrive. Specify below command line for the "Target" field in the shortcut
property dialog. Note: below line is a single line. It may be broken into
multiple lines by your usenet reader application.
cmd.exe /c taskkill onedrive.exe /f & timeout 10 & "C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe" /background"
Many thanks that works perfectly (with one tiny correction):

cmd.exe /c taskkill /im onedrive.exe /f & timeout 10 & "C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe" /background"

I have no idea why that works without the Administrator error issue but
again thanks very much.

Loading...