+ Post New Thread
Results 1 to 7 of 7
Windows Vista Thread, Running batch files in vista in Technical; when i try and run a batch file in vista the line just loops and has no effect any ideas ...
  1. #1

    Join Date
    Feb 2007
    Location
    Lincolnshire
    Posts
    120
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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?

  2. #2
    kestrel1's Avatar
    Join Date
    Jul 2005
    Location
    New Forest
    Posts
    294
    Thank Post
    3
    Thanked 11 Times in 11 Posts
    Rep Power
    20

    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.

  3. #3

    Join Date
    Feb 2007
    Location
    Lincolnshire
    Posts
    120
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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

  4. #4
    kestrel1's Avatar
    Join Date
    Jul 2005
    Location
    New Forest
    Posts
    294
    Thank Post
    3
    Thanked 11 Times in 11 Posts
    Rep Power
    20

    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.

  5. #5

    Join Date
    Feb 2007
    Location
    Lincolnshire
    Posts
    120
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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 ?

  6. #6
    JohnCondon's Avatar
    Join Date
    Apr 2007
    Location
    Bromcom
    Posts
    283
    Thank Post
    47
    Thanked 64 Times in 41 Posts
    Rep Power
    26

    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.

  7. #7

    Join Date
    Sep 2007
    Location
    Auburn, AL
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    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 ""

SHARE:
+ Post New Thread

Similar Threads

  1. Rename a batch of files all at once.
    By Kyle in forum How do you do....it?
    Replies: 10
    Last Post: 19th November 2009, 06:31 AM
  2. Vista isn't running logon scripts
    By woody in forum Windows Vista
    Replies: 6
    Last Post: 30th January 2007, 03:32 PM
  3. When are you installing Windows Vista and running it?
    By wesleyw in forum Windows Vista
    Replies: 13
    Last Post: 25th January 2006, 09:03 AM
  4. numbers and batch files
    By russdev in forum Windows
    Replies: 4
    Last Post: 19th November 2005, 09:51 PM
  5. Blocking Batch Files using Group Policy in Server 2003
    By markwilliamson2001 in forum Windows
    Replies: 13
    Last Post: 4th October 2005, 05:28 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •