I created the following .bat file in order to shutdown onedrive service:
whoami
"C:\Program Files\Microsoft OneDrive\OneDrive.exe" /shutdown
If I double-click on the .bat icon file, this works. Also, this works when I run a command line shell and type "C:\Users\john\Desktop\onedrive-shutdown.bat".
Now, I am running a Jenkins service on the same windows server which is connected as john (logon properties) and I created a project which consists of the following build step:
Unfortunately, the /shutdown process hangs up/loops since I am getting the following output:
whoami
john
"C:\Program Files\Microsoft OneDrive\OneDrive.exe" /shutdown
(and ... icon. Also, OneDrive won't be shutdown).
What am I missing?
Note that:
- Jenkins service logon properties is set as:
john - I tried
psexec64 -i 1 -u john -p PASSWORD "C:\Program Files\Microsoft OneDrive\OneDrive.exe" /shutdown, but this won't work (same results). - I cannot use
runassince userjohnuser has got a password. - Any other
.batfile, such asecho "Hello World"works fine.
