Enviroment Variables issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I am having trouble with system commands from the command prompt or run dialog. If I try to run a system command, such as ping, traceroute, tasklist, taskkill, etc... from the command prompt or run dialog, I get a message saying that it is an invalid command. If I move to the system32 directory, they work fine. I have checked my enviroment variables and %SystemRoot%, and %SystemRoot%\System32 are both in there, and "c:\>cd %SystemRoot%" works just fine. Any help would be appreciated.

Thanks
 
Type "set" at a command prompt and see what it says for "path"

Jon


parcelbrat said:
Hi, I am having trouble with system commands from the command prompt or
run dialog. If I try to run a system command, such as ping, traceroute,
tasklist, taskkill, etc... from the command prompt or run dialog, I get a
message saying that it is an invalid command. If I move to the system32
directory, they work fine. I have checked my enviroment variables and
%SystemRoot%, and %SystemRoot%\System32 are both in there, and "c:\>cd
%SystemRoot%" works just fine. Any help would be appreciated.
 
Both the system directories are in the path env variable.

Just in case, here's the output of Path:

PATH=D:\Perl\bin\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;
 
I'm surprised at that actually, since if I type "set" or "set path" at a
command prompt the output is

Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;...........

and not
PATH=.........%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;

The same if I view it via
Right-click My Computer > Properties > Advanced > Environment variables >
( click on path) > Edit
(as you're no doubt aware)

Suggestion ...
Make a backup copy of your PATH variable (eg press ctrl-c to copy it, when
viewing via the "My Computer" route, then paste it somewhere eg into
notepad) and then change the "%systemroot%" in your PATH variable (not the
%systemroot% itself!!) to "C:\WINDOWS" (or wherever your Windows folder is )
for each of the entries that contains it.

Hope this helps

Jon




parcelbrat said:
Here's the output of Path:
PATH=D:\Perl\bin\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\W
bem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program
Files\Microsoft SQL Server\80\Tools\Binn\;
 
Sorry spoke to soon. It does show

PATH=.........%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;

if I view it via this route

Right-click My Computer > Properties > Advanced > Environment variables >
( click on path) > Edit"

but not on the screen prior to pressing "Edit" if that makes sense


Jon
 
If you are getting the %systemroot% in path when you keyin set in a command
window, the path variable is no longer a reg_expand_sz type. You should
check in the registry for HKEY_LOCAL MACHINE\System\Current Control
Set\Control\Session Manager\Environment and see what the type of the PATH
is. If it is a REG_SZ change it back to a REG_EXPAND_SZ, this allows the
system to expand the variable and find the directories.

John Tiedt
 

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

Back
Top