OrionCookies
Programmer
Hi.
I'm tring to pass params to run vbscript.
for example
cscript.exe /nologo L:\Scripts\PassParam.vbs DelFld
or cscript.exe /nologo L:\Scripts\PassParam.vbs CrtFld
I am getting runtime error:wrong number of arguments.
Need help
thanks in advance...
'*****************here is my code
dim filespec, DirSpec, sstring
sstring = string
DirSpec = "c:\temp\test"
filespec = "c:\temp\test.tst"
'============================
function main(sstring)
if (sString="DelFld") then
DeleteFiles(filespec)
elseif (sString="CrtFld") then
CreationDate(DirSpec)
end if
end function
FUNCTION CreationDate(DirSpec)
Dim fso, f
SET fso = CreateObject("ScriptINg.FileSystemObject")
fso.DeleteFolder(DirSpec)
END Function
FUNCTION DeleteFiles(filespec)
DIM fso
SET fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile(filespec)
END Function
I'm tring to pass params to run vbscript.
for example
cscript.exe /nologo L:\Scripts\PassParam.vbs DelFld
or cscript.exe /nologo L:\Scripts\PassParam.vbs CrtFld
I am getting runtime error:wrong number of arguments.
Need help
thanks in advance...
'*****************here is my code
dim filespec, DirSpec, sstring
sstring = string
DirSpec = "c:\temp\test"
filespec = "c:\temp\test.tst"
'============================
function main(sstring)
if (sString="DelFld") then
DeleteFiles(filespec)
elseif (sString="CrtFld") then
CreationDate(DirSpec)
end if
end function
FUNCTION CreationDate(DirSpec)
Dim fso, f
SET fso = CreateObject("ScriptINg.FileSystemObject")
fso.DeleteFolder(DirSpec)
END Function
FUNCTION DeleteFiles(filespec)
DIM fso
SET fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile(filespec)
END Function