it's ok for me to run below script on win XP, but on win 7x64 occur below error
line: 25
char: 31
error: the system can not find the file specified
code: 80070002
source: (null)
any one can help?
script as below:
Dim WshShell, objXL, file
Dim currpath, filename, filexls, filebat
Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
currpath =
fso.GetFile(WScript.ScriptFullName).ParentFolder.ShortPath
filename = "PLFTP"
filexls = currpath & "\" & filename & ".XLS"
filebat = currpath & "\" & filename & ".BAT"
folderupload = currpath & "\UPLOAD"
if (not fso.FileExists(filexls)) then
msgbox "file <" & filename & ".XLS> is missing, FTP process
aborts"
else
if (not fso.FolderExists(folderupload)) then
msgbox "subfolder <UPLOAD> is missing, FTP process aborts"
else
set file = fso.GetFile(filexls)
select case file.attributes
case 0
case 32 Set objXL =
WScript.CreateObject("Excel.Application")
objXL.Workbooks.Open filexls
if (fso.FileExists(filebat)) then
WshShell.run "command /c " & filebat
end if
case 1 msgbox "file <" & filexls & "> is READONLY,
FTP process aborts"
case Else msgbox "file <" & filexls & "> is not in
normal status (" & _
file.attributes & "), FTP process
aborts"
end Select
end if
end if
line: 25
char: 31
error: the system can not find the file specified
code: 80070002
source: (null)
any one can help?
script as below:
Dim WshShell, objXL, file
Dim currpath, filename, filexls, filebat
Set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
currpath =
fso.GetFile(WScript.ScriptFullName).ParentFolder.ShortPath
filename = "PLFTP"
filexls = currpath & "\" & filename & ".XLS"
filebat = currpath & "\" & filename & ".BAT"
folderupload = currpath & "\UPLOAD"
if (not fso.FileExists(filexls)) then
msgbox "file <" & filename & ".XLS> is missing, FTP process
aborts"
else
if (not fso.FolderExists(folderupload)) then
msgbox "subfolder <UPLOAD> is missing, FTP process aborts"
else
set file = fso.GetFile(filexls)
select case file.attributes
case 0
case 32 Set objXL =
WScript.CreateObject("Excel.Application")
objXL.Workbooks.Open filexls
if (fso.FileExists(filebat)) then
WshShell.run "command /c " & filebat
end if
case 1 msgbox "file <" & filexls & "> is READONLY,
FTP process aborts"
case Else msgbox "file <" & filexls & "> is not in
normal status (" & _
file.attributes & "), FTP process
aborts"
end Select
end if
end if