There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
antivirus audio avg avg 8 backup bios boot browser bsod computer cpu crash css desktop driver dvd email error excel explorer firefox firefox 3 freeze game graphics hard drive hardware help please hijackthis hjt install internet internet explorer itunes javascript keyboard lan laptop malware missing monitor msn network networking openoffice outlook outlook 2003 outlook express php popups problem router screen seo slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp wireless word
DOS/PDA/Other
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Solved: Batch File Loops for Some Reason


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
Belfento's Avatar
Junior Member with 9 posts.
 
Join Date: Apr 2008
Experience: Intermediate
19-Apr-2008, 12:37 PM #1
Solved: Batch File Loops for Some Reason
I wrote a batch file to shut down my computer, so I could use Scheduled Tasks to shut it down every day at 9:00 AM. The batch file is as follows:

shutdown /s /f /t 30 /d p:1:1

Every time I execute the batch file, it just loops endlessly, without actually executing the command. When I enter that command in the cmd window, it works just fine.

Am I missing something?
TheOutcaste's Avatar
Computer Specs
Senior Member with 1,537 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
21-Apr-2008, 09:12 AM #2
Not sure what you mean by "loops endlessly"
Do you get the shutdown message and the 30 second countdown popup, then that repeats?
Or, does the command prompt just fill with the shutdown command and you get no popup?
Are you running the batch file from a command prompt, or double clicking the file on the desktop or from Windows Explorer?
What OS - Win9x, Win2K, WinXP, Vista, ???
__________________
Of course I know all the answers ; I just don't always match the answers to the right questions

Warning -- Windows spoken here. (Rated R for Strong Language and Violence -- When your Windows PC flies through a window, that's violent, right?)
Belfento's Avatar
Junior Member with 9 posts.
 
Join Date: Apr 2008
Experience: Intermediate
21-Apr-2008, 01:28 PM #3
Quote:
Originally Posted by TheOutcaste View Post
Not sure what you mean by "loops endlessly"
Do you get the shutdown message and the 30 second countdown popup, then that repeats?
Or, does the command prompt just fill with the shutdown command and you get no popup?
Are you running the batch file from a command prompt, or double clicking the file on the desktop or from Windows Explorer?
What OS - Win9x, Win2K, WinXP, Vista, ???

It just fills the command prompt with the command, and I get no popup.
I tried double-clicking the batch file, and running it from the command prompt, and I get the same result.
I'm running Windows XP Home Edition.
TheOutcaste's Avatar
Computer Specs
Senior Member with 1,537 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
21-Apr-2008, 01:44 PM #4
Did you by chance name the batch file shutdown.bat? If so, it is calling itself, not the shutdown.exe program.
Name the batch file something else, or include the extension in the batch file:
Code:
shutdown.exe /s /f /t 30 /d p:1:1
Belfento's Avatar
Junior Member with 9 posts.
 
Join Date: Apr 2008
Experience: Intermediate
21-Apr-2008, 01:47 PM #5
Yeah, that fixed it. Thank you.
TheOutcaste's Avatar
Computer Specs
Senior Member with 1,537 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
21-Apr-2008, 01:53 PM #6
You're Welcome!

If your issue has been resolved you (and ONLY you) can use the Thread Tools at the Upper Right (above the first post) to mark this thread Solved.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:05 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.