Microsoft
Software
Hardware
Network
Question : Bat file keeps repeating at command line
I'm not sure completely how to explain this, but I have a probelm in that I am trying to create a bat file that defrags the hard drive of a computer. I think I have the syntax down correctly:
defrag c:
exit
and I name the file defrag.bat. When I double click on it to run it, it pulls up the command window as you would expect, but then it just infinately repeats the command c:\defrag c: over and over but doesn't actually do anything. The only way to get it to stop is to close the command window. I could swear I have resolved this once before by moving the location of the bat file to a different location other than the root of the c: drive. I tried doing this to resolve and it didn't make a difference. Could someone give me some advice on how to fix this?
tbone
Answer : Bat file keeps repeating at command line
Since your batch file is called defrag, it is called by defrag.cmd. You can get around that by either renaming your batch file to e.g. dfrg.cmd, or by using:
defrag.exe c:
exit
BTW, the exit is superflous.
Random Solutions
Scripting Problem with IFMEMBER
Web Service or WCF? Current system uses thumb drives.
Page life expectancy
OK to remove "Windows\TEMP ?
Moving Navision 3.70 to new SQL Server installation
$INSERT permission denied on object 'TABLE NAME', database 'ACB', owner 'dbo'. sp_ABC
Access Report export question: DoCmd.OutputTo can't export Excel 1997-2003 format?
.Net C# Getting the error: The remote server returned an error: (401) Unauthorized. when using OWA Outlook Web Access
VBA code to paste into webpage textbox and select from a dropdown box.
Run antivirus/spyware outside Windows XP environment?