Hello everyone,
Hoping someone will help me here. I have a script that asks for a directory and a subdirectory name. I need the script to go to the directory and then open the subdirectory entered but somehow I cannot get it to work. Here's what I have:
CONST strDir = "c:\test"
set objShell = CreateObject("WScript.Shell")
set objFSO = CreateObject("Scripting.FileSystemObject")
function findFolder(strDir, strFlag1)
set objFolder = objFSO.GetFolder(strDir)
for each objSubFolder in objFolder.SubFolders
if (inStr(objSubFolder.Name, strFlag1)) then
findFolder = objSubFolder.Path
exit function
else
findFolder = findFolder (objSubFolder.Path, strFlag1)
end if
next
end function
strFlag1 = inputBox("Enter Client")
strFlag2 = inputBox("Enter case")
strWeb = findFolder(strDir, strFlag1) & "\strflag2"
objShell.Run strWeb
Hoping someone will help me here. I have a script that asks for a directory and a subdirectory name. I need the script to go to the directory and then open the subdirectory entered but somehow I cannot get it to work. Here's what I have:
CONST strDir = "c:\test"
set objShell = CreateObject("WScript.Shell")
set objFSO = CreateObject("Scripting.FileSystemObject")
function findFolder(strDir, strFlag1)
set objFolder = objFSO.GetFolder(strDir)
for each objSubFolder in objFolder.SubFolders
if (inStr(objSubFolder.Name, strFlag1)) then
findFolder = objSubFolder.Path
exit function
else
findFolder = findFolder (objSubFolder.Path, strFlag1)
end if
next
end function
strFlag1 = inputBox("Enter Client")
strFlag2 = inputBox("Enter case")
strWeb = findFolder(strDir, strFlag1) & "\strflag2"
objShell.Run strWeb