0

I have this environment variable set in the system control panel on my Windows 7 machine:

C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\RSA SecurID Token Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\CaseWare IDEA\IDEA;C:\Program Files (x86)\CaseWare IDEA\IDEA;C:\Program Files\Dell\Dell Data Protection\Encryption\;C:\HashiCorp\Vagrant\bin;C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client\;C:\Program Files\Git\cmd; C:\Python27;C:\Program Files\Amazon\AWSCLI\; C:\Program Files\Splunk\bin

But for some reason none of the programs I'm trying to access like python, aws cli and splunk are not found when I try to run them.

For instance when I try to run splunk it's not found, even tho I clearly added it's bin file to the path:

    PS C:\Users\tdunphy> splunk
splunk : The term 'splunk' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ splunk
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (splunk:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

What am I doing wrong?

user99201
  • 171
  • 1
  • 4
  • 13
  • Your path variable is already extremely long, and there is a limit to how long the variable actually can be, the reason the variable(s) you have added cannot be found is you likely had already exceeded that limit before you added the additional text. – Ramhound Jan 04 '18 at 19:53
  • Your path is 790 characters long. It's too long. – I say Reinstate Monica Jan 04 '18 at 19:53
  • ok guys thanks. This was setup by my IT dept not me. I'll correct it. – user99201 Jan 04 '18 at 19:54
  • I reduced the path to this which should be under the character limit 1C:\Windows\system32;C:\Windows\System32\WindowsPowerShell\v1.0;C:\HashiCorp\Vagrant\bin;C:\Program Files (x86)\Cisco\Cisco AnyConnect Secure Mobility Client;C:\Program Files\Git\cmd; C:\Python27;C:\Program Files\Amazon\AWSCLI;C:\Program Files\Splunk\bin1 and it still can't find splunk! Any more ideas? – user99201 Jan 04 '18 at 20:03
  • If you launch a command prompt rather than a Powershell prompt, does it work? What is the output of set path and where.exe splunk from the command prompt? – HelpingHand Jan 04 '18 at 20:26
  • yes, thanks. If I use the command prompt instead of the Powershell prompt splunk is on my path and it works. Is there any way I can make the power shell prompt aware of the new PATH? – user99201 Jan 04 '18 at 20:38
  • also where.exe splunk on the command prompt gives the location of splunk, but on power shell it does not. – user99201 Jan 04 '18 at 20:39
  • If you open a new PS command prompt and run: $env:path does the Splunk path show? – HelpingHand Jan 04 '18 at 23:05
  • I found out if I close the PS command prompt and reopen it, the $env:path variable shows the splunk path and I can execute the splunk command. Thanks! – user99201 Jan 05 '18 at 15:18
  • Relevant: https://msdn.microsoft.com/library/windows/desktop/ms682653(v=vs.85).aspx – HelpingHand Jan 06 '18 at 10:32

0 Answers0