computing
  • 31

Windows XP Won’t Execute Batch Program At All

  • 31

I have been programming BAT files since 1982 and never seen this issue before. I am running XP and my batch files do not function properly. All my commands are ignored including:
SET PATH=
IF EXIST <filename>
GOTO
In addition, the command-line memory doesn’t work on this machine. Usually I press PgUp to see and execute previous lines held in a buffer. Nothing is there.

How can WINDOWS work if there is no ability to execute commands in a batch file?

Here is the actual run. Even change drive fails:

C:\DOCUME~1\JOAN\DESKTOP>set path=c:\util;c:\windows\system32;c:\windows

C:\DOCUME~1\JOAN\DESKTOP>path
PATH=c:\util;c:\windows\system32;c:\windows

C:\DOCUME~1\JOAN\DESKTOP>set
ALLUSERSPROFILE=C:\DOCUME~1\ALLUSE~1
APPDATA=C:\DOCUME~1\Joan\APPLIC~1
BLASTER=A220 I5 D1 P330 T3
CLASSPATH=.;C:\Program Files\Java\jre1.6.0_05\lib\ext\QTJava.zip
COMMONPROGRAMFILES=C:\PROGRA~1\COMMON~1
COMPUTERNAME=DFM4JM91
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\Joan
LOGONSERVER=\\DFM4JM91
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
PATH=c:\util;c:\windows\system32;c:\windows
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0409
PROGRAMFILES=C:\PROGRA~1
PROMPT=$P$G
QTJAVA=C:\Program Files\Java\jre1.6.0_05\lib\ext\QTJava.zip
SESSIONNAME=Console
SONICCENTRAL=C:\Program Files\Common Files\Sonic Shared\Sonic Central\
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINDOWS
TEMP=C:\WINDOWS\TEMP
TMP=C:\WINDOWS\TEMP
USERDOMAIN=DFM4JM91
USERNAME=Joan
USERPROFILE=C:\DOCUME~1\Joan

C:\DOCUME~1\JOAN\DESKTOP>r:

C:\DOCUME~1\JOAN\DESKTOP>path
PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROGRA~1\COMMON~
1\ROXIOS~1\DLLSHA~1\;C:\PROGRA~1\QUICKT~1\QTSyst

Notice that the PATH and SET commands inside the batch file seemed to work, but the change-drive command (R:) failed and the last line (PATH) entered immediately after the run shows the original path restored.

This seems impossible, but it’s true. And rebooting made no difference.

I’m stumped. Anyone have some idea of what is happening, and how to fix it?

What makes it even stranger is that the little sub,bat program does work and does set up three SUBST drives

Share

1 Answer

  1. Not if you believe the comspec var.
    It’s full of lies, says I.

    Thu 10/07/2010 17:24:43++
    E:\Cpp\WinSDK>command
    Microsoft(R) Windows DOS
    (C)Copyright Microsoft Corp 1990-2001.
    
    
    Thu 10/07/201017:24:49
    E:\CPP\WINSDK>echo %comspec%
    C:\WINDOWS\system32\cmd.exe

    In a more serious note, it’d explain pretty much everything, including why his prompt is in 8.3 notation.

    How To Ask Questions The Smart Way

    • 0