Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

DOS/Other DOS/Other
Search Search
Search for:
Tech Support Guy > > >

Solved: Batch File Loops for Some Reason


(!)

Belfento's Avatar
Belfento Belfento is offline
Junior Member with 9 posts.
THREAD STARTER
 
Join Date: Apr 2008
Experience: Intermediate
19-Apr-2008, 11:37 AM #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
Member with 9,028 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
21-Apr-2008, 08: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, ???
Belfento's Avatar
Belfento Belfento is offline
Junior Member with 9 posts.
THREAD STARTER
 
Join Date: Apr 2008
Experience: Intermediate
21-Apr-2008, 12: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
Member with 9,028 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
21-Apr-2008, 12: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
Belfento Belfento is offline
Junior Member with 9 posts.
THREAD STARTER
 
Join Date: Apr 2008
Experience: Intermediate
21-Apr-2008, 12:47 PM #5
Yeah, that fixed it. Thank you.
TheOutcaste's Avatar
Computer Specs
Member with 9,028 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
21-Apr-2008, 12: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.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




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


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2