Guest Thufir Posted October 3, 2007 Posted October 3, 2007 This command, from the command line, works fine. The batch file hangs, but I don't know why. A "hello world" batch file worked fine. Here's the batch file: Microsoft Windows XP [Version 5.1.2600] © Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\thufir> C:\Documents and Settings\thufir> C:\Documents and Settings\thufir>cd Desktop C:\Documents and Settings\thufir\Desktop> C:\Documents and Settings\thufir\Desktop> C:\Documents and Settings\thufir\Desktop>type reg.bat @echo off rem type reg.bat reg query "HKLM\SOFTWARE\Microsoft\" /s > registry.txt C:\Documents and Settings\thufir\Desktop> C:\Documents and Settings\thufir\Desktop> thanks, Thufir
Guest Pegasus \(MVP\) Posted October 3, 2007 Posted October 3, 2007 Re: why does the reg query command hang? "Thufir" <hawat.thufir@gmail.com> wrote in message news:1191370687.918209.29590@o80g2000hse.googlegroups.com... > This command, from the command line, works fine. The batch file > hangs, but I don't know why. A "hello world" batch file worked fine. > > > Here's the batch file: > > Microsoft Windows XP [Version 5.1.2600] > © Copyright 1985-2001 Microsoft Corp. > > C:\Documents and Settings\thufir> > C:\Documents and Settings\thufir> > C:\Documents and Settings\thufir>cd Desktop > > C:\Documents and Settings\thufir\Desktop> > C:\Documents and Settings\thufir\Desktop> > C:\Documents and Settings\thufir\Desktop>type reg.bat > @echo off > > rem type reg.bat > > reg query "HKLM\SOFTWARE\Microsoft\" /s > registry.txt > > > > C:\Documents and Settings\thufir\Desktop> > C:\Documents and Settings\thufir\Desktop> > > > > > thanks, > > > Thufir > Your command does not hang - it keeps running round in circles. The reason is simple: You gave the batch file the same name as you gave your executable, namely "reg". When your batch file runs the line reg query "HKLM\SOFTWARE\Microsoft\" /s > registry.txt then it keeps calling itself! Give your batch file a unique name, e.g. "RegBat.bat". Your problem will disappear immediately. In future remember that you must NEVER give a batch file the same name as that of an executable.
Guest Thufir Posted October 3, 2007 Posted October 3, 2007 Re: why does the reg query command hang? ROFL. ok, thanks. -Thufir
Recommended Posts