Running batch files in vista
when i try and run a batch file in vista the line just loops and has no effect any ideas
shutdown -s -m \\PC01 -t 60 -c "Shutting down system"
this just loops in a dos window :S
now if i add
START shutdown -s -m \\PC01 -t 60 -c "Shutting down system"
things gett messy lol (windows continuosly opening)
Edit:- Tries using a vbs script to sendd to dos window that failed as well any ideas anyone?
or even a shutdown script that runs directly through vbs?
Re: Running batch files in vista
Not sure if the AT command still works in Vista, but it works with XP, Server 2003.
Go to a command prompt (DOS box) type 'at 00:00 shutdown -s -m \\PC01 -t 60 -c "Shutting down system"'
where 00:00 is the time you want this to take place.
I assume Vista has the shutdown command.
Re: Running batch files in vista
i will give it a go i can excute all normal shutdown etc from run line its just batch files it hates
Re: Running batch files in vista
as long as the AT command is still available in Vista it should work.
I use this method to reboot the servers during the night & to shutdown machines after a certain time.
To find out the full list of parameters type 'at -?' at a command prompt.
You can specify days of the week, so that this is a scheduled task & is not deleted after it has run once.
Re: Running batch files in vista
After a bit of testing i got the file to work the user had permissions over the domain and local admin permissions, but i still have to right click the batch file and run as administrator!
any way i thought no matter i will use compatibility in the shortcut to set it to always run as admin but this option is greyed out so anyone got any ideas to enable this i am guessing somewhere vista block bats being set to auto admin, any one ?
Re: Running batch files in vista
This is purely from my own limited experience of Vista on my home system but it seems to have a general hatred of all things .BAT.
However try using the extension .CMD instead. It works for very simple batch files eg. the sort used to launch Java apps.
Not sure what syntax differences there are between .BAT and .CMD (may be none).
Give it a try.
Re: Running batch files in vista
The shutdown command has changed for Vista. Instead of dashes you use forward slashes. Example: shutdown.exe /r /t 30 /c ""