Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Standard Windows batch script not working

26 Nov 2010   #1

Windows 7 Ultimate
Standard Windows batch script not working

I am trying to run a simple shutdown script..easy no big deal
shutdown -r -t 00
And I created a desktop shortcut and assigned a hot key to it to speed up the process.

Problem is I try to launch the batch script and instead I get a command prompt window that goes to the script directory, types / activates CMD then does nothing? Prior doing this in XP worked like a charm, why does it not work in Windows 7? I also tried to run the script as administrator AND checked permissions and took ownership and also tried running it in compatability mode, still no luck.

Please help.

My System SpecsSystem Spec
26 Nov 2010   #2

Windows 7 Ultimate x64 SP1 clean install

Hi and welcome to Seven Forums!

Have you tried to run shutdown at a command prompt?
My System SpecsSystem Spec
26 Nov 2010   #3
PooMan UK

Windows 7 Ultimate 64bit

Just pressing the power button once on the pc does the same thing, wouldn't this be just as quick ? .... just a thought
My System SpecsSystem Spec

26 Nov 2010   #4

Windows 7 Ultimate x64

Try creating a shortcut on the desktop that does not use a batch file:

1) Right-Click an unused part of the desktop, click "New", Click "Shortcut":
Standard Windows batch script not working-image2.jpg

2) Use "C:\Windows\System32\shutdown.exe /p" (without quotes) as the location of the item, then click "Next". You will obviously use your own desired parameters for the SHUTDOWN command instead of /p:
Standard Windows batch script not working-image3.jpg

3) Type a name for the shortcut, then click "Finish":
Standard Windows batch script not working-image4.jpg

4) Open the properties of the newly created shortcut, and change the shortcut key and/or icon according to your own desire:
Standard Windows batch script not working-image1.jpg

I use this to force an emmidiate shutdown of Windows if I don't want to install updates first...

My System SpecsSystem Spec
26 Nov 2010   #5

Windows 7 Ultimate x86

Not really helpful in your case but the shutdown command would be
shutdown.exe –s –t 00
-r is reboot.
My System SpecsSystem Spec
26 Nov 2010   #6

Windows 7 Ultimate (x64)

Your command worked fine in my system (i.e. re-booted it) - I simply typed it into the command prompt. Thus it should work, except it's possible that in your system execution of batch files is somehow restricted - by analogy with PowerShell scripts which are restricted by default. Check your Group Policy settings.
My System SpecsSystem Spec

 Standard Windows batch script not working

Thread Tools

Similar help and support threads
Thread Forum
Why is my batch script freezing? (windows 7)
This is not the entire script but this the line that is freezing, i'm just trying to compile some basic information from the computers in my domain with this login script. When running just this line as a bat file it will hang until closed and when you attempt to close CMD it lags up and...
General Discussion
Help Need in batch script
Hi, I have my vendor's ftp url over SSL. it's like ftps:// and i have username and password. So please help me on writing batch script t o downlod the file from my vendor repository. If this is not possible in dos script, please suggest me opensource tool. But i would love the...
General Discussion
W10 TP : Old Windows Update Batch/Script
Hi, I need you for obtain a batch for apply this custom : Retrouvez votre bon vieux Windows Update sous Windows 10 - Le comptoir du hardware Can you help me ? Thanks Have a good day !
Windows Updates & Activation
Windows 7 creating blank txt file after running a batch script
I have the following batch script @echo off setlocal enableextensions set "baseName=dnshistory" set "count=0" for /f "delims=%baseName%." %%a in (
General Discussion
batch script help
dear all any help to make batch script this the reason i want to make a batch file is to help me update the online games in 60 computers by overwriting or copying big files in one click from 1 source computer... instead of turning on all 60 computers and updating all online games, he'll just...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 13:45.
Twitter Facebook Google+