windows variables

doctorbill
doctorbill used Ask the Experts™
on
Problem:
Windows 7 Ultimate 64 bit

All of a sudden , in order to run batch command such as taskkill, I need to do the following:
c:\windows\system32\taskkill

Before I just need to use the line taskkill and not define the full path to the exe file

I assume this is a system variables issue but I cannot see where the problem is
I have tried adding the "c:\windows" and "c:\windows\system32" to my path varuiables under Path but I am unable to append any new text to the Path which is vvery strange in itself
%SystemRoot% and %SystemRoot%\system32 are in the Path text already

Help appreciated please
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018
Commented:
> have tried adding

How did you try to add it? Here's how I do it:

Control Panel
System
Advanced system settings
Advanced
Environment variables...
Path
Edit...

Note that there is a Path variable in both the User section and the System section. The way it works is that the User Path is appended to the System Path, so perhaps you're running into the maximum Path environment variable size of 4095 characters in W7. Regards, Joe

Author

Commented:
So what do I do
Can I add it in the User variable section
If so, exactly what do I add
Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015
Commented:
Check in a cmd prompt whether SystemRoot is set. You can do so by entering set sys, which should show only this variable.
Also, check if Path in the cmd prompt has the %SystemRoot% unexpanded - which is wrong, you should see the complete path there.

Author

Commented:
If I open a cmd and type set sys I get the following:
SystemDrive=c:
SystemRoot=c:\Windows

If I Type Path I get:
PATH=(null)
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018
Commented:
Sorry for the delay...walking the dog. But glad to see that Qlemo jumped in. What happens when you enter Path in an elevated command prompt? There are numerous ways to get an elevated prompt. One is Start>All Programs>Accessories then right-click on Command Prompt and select Run as administrator. Regards, Joe

Author

Commented:
How does one use "Path" in a cmd prompt

Author

Commented:
Path=(null)
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018
Commented:
> How does one use "Path" in a cmd prompt

You don't "use" it, per se. Entering "path" in the command prompt shows you its value. When you run a program in a command prompt, such as gm.exe as discussed in this EE article, Windows searches all folders in the Path variable to find the executable (that's why the program mentioned in that article has a check-box to "Update executable search path"). Regards, Joe
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018
Commented:
> Path=(null)

Well, that is really strange! My Path variable in W7 is around 2,000 characters. Here's an EE question with the same issue:
http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_24193630.html

It's from more than six years and is about XP, but perhaps it will help. Regards, Joe

Author

Commented:
If I type in "Set" the Path variable set does not show up !!!!!
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018
Commented:
What variables do you see in the command prompt when you enter "set" by itself?
Commented:
I have managed to solve thsi with the help of all of you:

It looks as if the last installation of an "advanced acronis system backup" program install a number of variables into the system PATH  which took it over the character limit
I copied all the variables from this path, removed the last few text variables from the path (ie the acronis variables) and copied the variables back into the PATH
Command prompt now shows up the PATH variables in the SET command

I copied the extra Acronis variables into another system path variable set called Acronis

Author

Commented:
I am very surprised that windows allowed the Path system variables to be exceeded

Author

Commented:
Thanks to you all
Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015

Commented:
Most of the installed programs will not need any PATH entry, but append themselves to it. I regularily remove stuff from PATH for that reason. To make it more simple, I'm defining additional vars like
_PATH_System, _PATH_DB, _PATH_Tools, with corresponding entries, and then put them together as
   PATH=%_PATH_System%;%PATH_DB%;
Besides having a short entry in the system applet, you always can see new paths - they are appended at the end or beginning in plain ;-).
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
You're welcome. And thanks to you for letting us know exactly what the problem was — very helpful! Regards, Joe

Author

Commented:
Thanks Joe - just realised that I should have put you as best solution as the probblem was number of characters
Sorry - my mistake
Joe WinogradDeveloper
Fellow 2017
Most Valuable Expert 2018

Commented:
Don't worry about it — not a big deal. Regards, Joe

Author

Commented:
Solved

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial