How to script a shutdown

Joined
May 17, 2010
Messages
9
Reaction score
0
I sometimes have to go into processes in order to shut down a programme that misbehaves. Is there a way of creating a link that I can put on the desktop, which I can click to shut it down?
 
Joined
May 17, 2010
Messages
9
Reaction score
0
Works a treat on my computer, thanks very much!

However I sent it to my colleague though and they said....
" i click on it and black command box comesup like its going to do something, then vanishes and it doesnt"

I used taskkill /pid hipchat.exe /f

and when it didn't work changed it to taskkill /im hipchat.exe /f but the same thing happened.
Any ideas?
 
Last edited:

Ian

Administrator
Joined
Oct 17, 2008
Messages
3,484
Reaction score
632
I'm not sure why it would work on one PC but not on another - but if you could ask your colleague to start a command prompt window (Windows Key + R > "cmd" > OK) then type in the command manually and hit enter, then it should show any errors rather then exiting the script. That may help us find the problem :).
 
Joined
May 17, 2010
Messages
9
Reaction score
0
Well, right clicking the .bat file and choosing run as administrator works for them.
How can I enable "run as administrator" for them all the time for that file?
 
Last edited:

Ian

Administrator
Joined
Oct 17, 2008
Messages
3,484
Reaction score
632
I'm not 100% sure this will work as I'm posting from Windows 10 at the moment so can't test, but I think it should be ok.

Create a shortcut to the batch file, right click it > properties > shortcut > advanced > then tick the run as administrator box. It's not possible to run the batch file as an admin directly, but using the shortcut as a workaround should do the trick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top