Cmd does not work properly

J

Jacques Schett

I have two Windows XP Pro systems on a domain that the command shell
does not work properly.

We use scripts to handle user rights on some poorly written apps
(security wise, poorly written...like QUickBooks) The script starts by
granting the user of this instance local admin rights. Then it
launches the app, then it resets the admin accounts and removes the
current user.

This works well on all but these two machines. What I get is scripts
that fail to work because the paths are implicit (i.e. I don't say
"C:\Windows\System32\Net.exe ..." instead I use "Net ..."

The PATH statement shows %SystemRoot%; %SystemRoot%\System32;... but
NOTHING works properly in the cmd shell.

How can I fix this short of reinstalling XP? Would SFC /ScanNow work?
I just hate to have to reinstall all the files since SP2 released (our
XP cd is slipstreamed with SP2 so at least I won't have to ins. the
SP.

Any thoughts are appreciated!
 
P

Pegasus \(MVP\)

Jacques Schett said:
I have two Windows XP Pro systems on a domain that the command shell
does not work properly.

We use scripts to handle user rights on some poorly written apps
(security wise, poorly written...like QUickBooks) The script starts by
granting the user of this instance local admin rights. Then it
launches the app, then it resets the admin accounts and removes the
current user.

This works well on all but these two machines. What I get is scripts
that fail to work because the paths are implicit (i.e. I don't say
"C:\Windows\System32\Net.exe ..." instead I use "Net ..."

The PATH statement shows %SystemRoot%; %SystemRoot%\System32;... but
NOTHING works properly in the cmd shell.

How can I fix this short of reinstalling XP? Would SFC /ScanNow work?
I just hate to have to reinstall all the files since SP2 released (our
XP cd is slipstreamed with SP2 so at least I won't have to ins. the
SP.

Any thoughts are appreciated!

You write "NOTHING works properly in the cmd shell." This
is far from sufficient to tell you what's wrong. You should post
the exact command you use and the verbatim error message
you get. Remember that we can't see your screen!
 
P

pop

Jacques said:
I have two Windows XP Pro systems on a domain that the command shell
does not work properly.

We use scripts to handle user rights on some poorly written apps
(security wise, poorly written...like QUickBooks) The script starts by
granting the user of this instance local admin rights. Then it
launches the app, then it resets the admin accounts and removes the
current user.

This works well on all but these two machines. What I get is scripts
that fail to work because the paths are implicit (i.e. I don't say
"C:\Windows\System32\Net.exe ..." instead I use "Net ..."

The PATH statement shows %SystemRoot%; %SystemRoot%\System32;... but
NOTHING works properly in the cmd shell.

How can I fix this short of reinstalling XP? Would SFC /ScanNow work?
I just hate to have to reinstall all the files since SP2 released (our
XP cd is slipstreamed with SP2 so at least I won't have to ins. the
SP.

Any thoughts are appreciated!

From a CMD prompt...

SET [enter]

and evaluate what you see. Compare to a working machine.

pop
 
J

Jacques Schett

Sorry for being too general.

What I mean by "Nothing" is that none of the normal paths seem to be
allowing access to normally used files.

e.g. If I open a CMD shell and CD \ to the root that works. If I type
"Net Use" to see a list of shares and redirects I get an error that
says the system cannot find any program called "Net".

If I type in the complete path (e.g. C:\Windows\System32\Net Use) then
NET works and I get a list of shares and redirections.

in short, I guess, my complaint is that the PATH is not being resolved
properly. If I type SET at the prompt, I can see all the default
lookup paths and they're normal (e.g. %SystemRoot%\System32 is in
there and if I type ECHO %SystemRoot% I get C:\Windows)

What could be causing this problem? As a result, none of the scripts
we execute work on these two machines (hence my saying NOTHING works).

This is just one example. If I drop to a command prompt and type in
NOTEPAD (which should launch notepad.exe) I get the same "Bad command
or filename" error, unless I put in the full path of the executable.
 
P

Pegasus \(MVP\)

Jacques Schett said:
Sorry for being too general.

What I mean by "Nothing" is that none of the normal paths seem to be
allowing access to normally used files.

e.g. If I open a CMD shell and CD \ to the root that works. If I type
"Net Use" to see a list of shares and redirects I get an error that
says the system cannot find any program called "Net".

If I type in the complete path (e.g. C:\Windows\System32\Net Use) then
NET works and I get a list of shares and redirections.

in short, I guess, my complaint is that the PATH is not being resolved
properly. If I type SET at the prompt, I can see all the default
lookup paths and they're normal (e.g. %SystemRoot%\System32 is in
there and if I type ECHO %SystemRoot% I get C:\Windows)

What could be causing this problem? As a result, none of the scripts
we execute work on these two machines (hence my saying NOTHING works).

This is just one example. If I drop to a command prompt and type in
NOTEPAD (which should launch notepad.exe) I get the same "Bad command
or filename" error, unless I put in the full path of the executable.

Much better!

You probably have the wrong type for the %path% key. Use
regedit.exe and check the path value under the key
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
It must be of type REG_EXPAND_SZ, not REG_SZ.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top