Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

Path Not Found when I use variables...

$
0
0
I am building a script that uses a user's input to create the path for a source folder. If I use a full path (the path that has been comment out), this works. Otherwise I get "Path Not Found". Can someone lead me in the right direction?


Code:

Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim sFolder : sFolder = "S:\" & newState & "\" & "Section_" & newSection & "\Images-tracetest"
'Dim sFolder  : sFolder = "S:\SOCAL\Section_31\Images-tracetest"
Dim newState, newSection, newArea, sFile

Call GetNewInputs()
                REM======================New Inputs===============================
Sub GetNewInputs()
     
        newState = UCase(InputBox("INPUT STATE or REGION:", _
        "INPUT STATE", "SOCAL"))
               
        newSection = ("Section_" & InputBox("INPUT SECTION NUMBER:", _
        "INPUT SECTION", "31"))
       
End Sub
For Each sFile In objFSO.GetFolder(sFolder).Files       
               
        uSplit  = split(file,"_")
        newArea    = uSplit(ubound(uSplit) - 1)
                               
        If InStr(sFile.Name, "CC") > 0 Then               
        WScript.Echo "We found a CC file! File is" & (sFile.name)
        'Call CCimage()
        Else
        End If
Next


Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>