Below is a snippet of my vbscript that check to see if a file(s) exists via a variable and writes to a log file if the file(s) exists. If I enter the parameters as per the labels below in the fso line, it works fine, however if I enter them as below is does not seem to pickup from the labels. How can I get my script to use the labels I have created.
Thanks
Set objFSO = CreateObject("Scripting.FileSystemObject")
set LogFile=objfso.opentextfile("dvdlog.txt",2,True)
branchid = InputBox("Enter Branch Number")
dvddrive = InputBox("Enter Drive Letter for DVD Writer")
Label = "b" + (branchid) + "sr01"
File1 = " c:\temp\b" + (branchid) + "sr01.0"
File2 = " c:\temp\b" + (branchid) + "sr01.1"
File3 = " C:\temp\b" + (branchid) + "sr01.2"
FileA = (dvddrive) + ":\b" + (branchid) + "sr01.0"
FileB = (dvddrive) + ":\b" + (branchid) + "sr01.1"
FileC = (dvddrive) + ":\b" + (branchid) + "sr01.2"
wscript.echo "File2 =" & chr(34) & FILE2 & chr(34)
If objFSO.FileExists (FILE3) then
logfile.writeLine ("3 Files Exist")
wscript.quit
end if
If objFSO.FileExists (FILE2) then
logfile.writeLine ("2 Files Exist")
wscript.quit
end if
If objFSO.FileExists (FILE1) then
logfile.writeLine ("1 Files Exist")
wscript.quit
end if
Thanks
Set objFSO = CreateObject("Scripting.FileSystemObject")
set LogFile=objfso.opentextfile("dvdlog.txt",2,True)
branchid = InputBox("Enter Branch Number")
dvddrive = InputBox("Enter Drive Letter for DVD Writer")
Label = "b" + (branchid) + "sr01"
File1 = " c:\temp\b" + (branchid) + "sr01.0"
File2 = " c:\temp\b" + (branchid) + "sr01.1"
File3 = " C:\temp\b" + (branchid) + "sr01.2"
FileA = (dvddrive) + ":\b" + (branchid) + "sr01.0"
FileB = (dvddrive) + ":\b" + (branchid) + "sr01.1"
FileC = (dvddrive) + ":\b" + (branchid) + "sr01.2"
wscript.echo "File2 =" & chr(34) & FILE2 & chr(34)
If objFSO.FileExists (FILE3) then
logfile.writeLine ("3 Files Exist")
wscript.quit
end if
If objFSO.FileExists (FILE2) then
logfile.writeLine ("2 Files Exist")
wscript.quit
end if
If objFSO.FileExists (FILE1) then
logfile.writeLine ("1 Files Exist")
wscript.quit
end if