Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check two folders for exist 1

Status
Not open for further replies.

GrimR

IS-IT--Management
Jun 17, 2007
1,149
ZA
How do I check two folders for existence. Then run the command.

I'm guessing something to do with null but the way I have it, it checks each folder separately.

Code:
folderPath = "C:\Program Files\Trend Micro\OfficeScan Client"
strfolder = "C:\Program Files (x86)\Trend Micro\OfficeScan Client"

'Checking
If NOT objFSO.FolderExists(folderPath) Then
		Return = WshShell.Run(Chr(34) & strProgPath & Chr(34),0,True) 
		
	else if NOT objFSO.FolderExists(strfolder) Then
		Return = WshShell.Run(Chr(34) & strProgPath & Chr(34),0,True)
		wscript.echo strfolder
	End If
End if



MCSE NT to 2012, MCITP:EA/SA, MCSA, MCDBA, MCTS, MCP+I, MCP
 
Something like this ?
If NOT objFSO.FolderExists(folderPath) Or NOT objFSO.FolderExists(strfolder) Then
or this ?
If NOT objFSO.FolderExists(folderPath) And NOT objFSO.FolderExists(strfolder) Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top