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

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":
Name:  Image2.jpg
Views: 4
Size:  72.0 KB

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:
Name:  Image3.jpg
Views: 4
Size:  51.8 KB

3) Type a name for the shortcut, then click "Finish":
Name:  Image4.jpg
Views: 3
Size:  40.9 KB

4) Open the properties of the newly created shortcut, and change the shortcut key and/or icon according to your own desire:
Name:  Image1.jpg
Views: 6
Size:  54.0 KB

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.
-DG
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
Reply

 Standard Windows batch script not working




Thread Tools



Similar help and support threads for2: Standard Windows batch script not working
Thread Forum
How to create batch script to lock workstation then log off. General Discussion
PDF file association REG or Batch Script Software
Admin privileges in batch script Software
Remotely trigger batch script? By email? Network & Sharing
Problem with echo in batch script General Discussion
Help me with Batch script! Software

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 09:46 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33