Standard Windows batch script not working


  1. Posts : 1
    Windows 7 Ultimate
       #1

    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 Computer


  2. Posts : 313
    Windows 7 Ultimate x64 SP1 clean install
       #2

    Hi and welcome to Seven Forums!

    Have you tried to run shutdown at a command prompt?
      My Computer


  3. Posts : 2,726
    Windows 7 Ultimate 64bit
       #3

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


  4. Posts : 1,261
    Windows 7 Professional 32-bit SP1
       #4

    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 Computer


  5. Posts : 2,009
    Windows 7 Ultimate x86
       #5

    Not really helpful in your case but the shutdown command would be
    shutdown.exe –s –t 00
    -r is reboot.
    -DG
      My Computer


  6. Posts : 797
    Windows 7 Ultimate (x64)
       #6

    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 Computer


 

  Related Discussions
Our Sites
Site Links
About 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 17:03.
Find Us