Setting an Environment Variable
It appears that the last issue of the newsletter sparked some real interest amongst many Infopackets Readers (RE: tracert.exe and ping.exe).
At this time, I would like to address the problem that Infopackets Reader Stephen C. wrote to me about not being able to access any MS DOS commands from the command prompt under Windows. He writes:
" When I [attempt to] run [MS DOS commands, such as ping.exe or tracert.exe] under the command window, I get an error message which reads: 'ping' is not recognized as an internal or external command, operable program or batch file. Any ideas? I have Windows 2000. "
There are two reasons for this error:
- Ping does not exist in the C:\> root directory;
- There is no Environment Variable set on Stephen's system which would normally point the command line to the appropriate directory to issue the ping.exe command.
Both of these problems combined will result in the error message Stephen received.
There is a simple fix which can be applied by editing the autoexec.bat file (described below). But before we get into that, let's look at what the Environment Variables might look like on a Windows 2000 system from the command line using the PATH command: C:\> path
PATH=C:\winnt\system32;C:\winnt;
Since Stephen could not access ping.exe from the command line (and any other MS DOS command commonly found in the above directories), it would require him to CHANGE DIRECTORY to the \winnt\system32 where the commands are stored every time he opened up an new command prompt window:
C:\> cd \winnt\system32
C:\winnt\system32> ping www.infopackets.com
This would provide Stephen with an immediate resolution, but there is a better (long term) solution: setting an Environment Variable for all command line sessions. This can be done by loading NOTEPAD (START -> PROGRAMS -> NOTEPAD) and editing the C:\autoexec.bat file.
Simply add a new line (anywhere) in this file that says:
PATH=C:\winnt;c:\winnt\system32;c:\windows;c:\windows\command
Note that this Environment Variable will hold true for anyone who has Windows installed on their C drive (either Windows 95, 98, 98SE, ME, NT, XP or 2000.
Finally, save the file and reboot Windows.
After the system has rebooted, a command line can be opened and any MS DOS command can be entered without first having to change directory to either winnt\system32 or windows\command (for all Windows users).
Most popular articles
- Which Processor is Better: Intel or AMD? - Explained
- How to Prevent Ransomware in 2018 - 10 Steps
- 5 Best Anti Ransomware Software Free
- How to Fix: Computer / Network Infected with Ransomware (10 Steps)
- How to Fix: Your Computer is Infected, Call This Number (Scam)
- Scammed by Informatico Experts? Here's What to Do
- Scammed by Smart PC Experts? Here's What to Do
- Scammed by Right PC Experts? Here's What to Do
- Scammed by PC / Web Network Experts? Here's What to Do
- How to Fix: Windows Update Won't Update
- Explained: Do I need a VPN? Are VPNs Safe for Online Banking?
- Explained: VPN vs Proxy; What's the Difference?
- Explained: Difference Between VPN Server and VPN (Service)
- Forgot Password? How to: Reset Any Password: Windows Vista, 7, 8, 10
- How to: Use a Firewall to Block Full Screen Ads on Android
- Explained: Absolute Best way to Limit Data on Android
- Explained: Difference Between Dark Web, Deep Net, Darknet and More
- Explained: If I Reset Windows 10 will it Remove Malware?
My name is Dennis Faas and I am a senior systems administrator and IT technical analyst specializing in cyber crimes (sextortion / blackmail / tech support scams) with over 30 years experience; I also run this website! If you need technical assistance , I can help. Click here to email me now; optionally, you can review my resume here. You can also read how I can fix your computer over the Internet (also includes user reviews).
We are BBB Accredited
We are BBB accredited (A+ rating), celebrating 21 years of excellence! Click to view our rating on the BBB.