Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Looking for a free program that reports on each folder in system and user path variables

Posted on 2016-08-31
7
Medium Priority
?
54 Views
Last Modified: 2016-09-02
Hi-

I'm looking for a free program that reports on each folder in system and user path variables whether the folder exists or not.

W10 64
0
Comment
Question by:SAbboushi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 25

Expert Comment

by:NVIT
ID: 41778776
Would you please clarify with an example of the kind of output you'd like?
0
 

Author Comment

by:SAbboushi
ID: 41778792
For each entry in the path variables, does the directory exist or not:

c:\abc      yes
c:\def      no
0
 
LVL 25

Accepted Solution

by:
NVIT earned 2000 total points
ID: 41779008
Here is a verified vbscript solution you can use.

- Make a PathDirExists.vbs file of this code
' Verify if folders in the PATH environment variable exist.
' Results are saved in file %TEMP%\PathDirExists.txt

Set objShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

Const ForAppending = 8
Dim outputArray
Dim FName
FName = objShell.ExpandEnvironmentStrings("%TEMP%") & "\PathDirExists.txt"

Set objTextFile = objFSO.OpenTextFile (FName, ForAppending, True)

'Process system PATH Env Variable
objTextFile.WriteLine("System PATH Variable=============================")
inputText = objShell.Environment("PROCESS").Item("PATH")
DoesDirExistInPath inputText

'Process user PATH Env Variable
objTextFile.WriteLine("User PATH Variable=============================")
inputText = objShell.Environment("USER").Item("PATH")
DoesDirExistInPath inputText

objTextFile.Close

Sub DoesDirExistInPath(Dir)
outputArray = split(inputText,";")

For each Dir in outputArray
	If objFSO.FolderExists(Dir) Then
		objTextFile.WriteLine("Yes=" & Dir)
	Else
		objTextFile.WriteLine("No=" & Dir)
	End If
Next
End Sub

Open in new window


- Open a CMD prompt
- Type cscript /nologo PathDirExists.vbs
- Result file PathDirExists.txt is in %temp% folder
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Closing Comment

by:SAbboushi
ID: 41779707
Perfect!  Any chance you can get the script to open the .txt file automatically using default editor?

Either way, thanks!
0
 
LVL 25

Expert Comment

by:NVIT
ID: 41782334
> ...get the script to open the .txt file automatically using default editor
Insteat of running cscript /nologo PathDirExists.vbs above, make a .bat file of this code:
cscript /nologo PathDirExists.vbs
if exist "%TEMP%\PathDirExists.txt" start "title" "%TEMP%\PathDirExists.txt"

Open in new window


Run the .bat in a CMD window.
0
 

Author Comment

by:SAbboushi
ID: 41782490
Thanks much!
0
 
LVL 25

Expert Comment

by:NVIT
ID: 41782498
You're welcome. Have a nice day/night.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring Remote Assistance for use with SCCM
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question