Hi All,
I am getting the Error while I am trying to run the Script
Test.VBS(5, 1) Microsoft VBScript runtime error: Object required:
'objShell.NameSpace(...)'
ndate = date()
ndate = ndate-0
strlongdate = formatdatetime(ndate,vblongdate)
strshortdate = formatdatetime(ndate,vbshortdate)
'wsh.echo "The yesterday date is : " & cstr(ndate)
'wsh.echo "The long date : " & strlongdate
'wsh.echo "The short date : " & strshortdate
strshortdatearray = split(strshortdate,"/")
'wsh.echo cstr(strshortdatearray(0))
'wsh.echo cstr(strshortdatearray(1))
'wsh.echo cstr(strshortdatearray(2))
'**********Set these values accordingly to the date format of the machine (2008-01-01)***********
str_short_year = cstr(strshortdatearray(2))
str_short_month = cstr(strshortdatearray(1))
str_short_day = cstr(strshortdatearray(0))
if len(str_short_day ) = 1 then
str_short_day = "0" & str_short_day
end if
if len(str_short_month ) = 1 then
str_short_month = "0" & str_short_month
end if
Option Explicit
'Extract "E:\PrePaid_Data\TN\SFAF\08_BAN_TN_SFAF_" & str_short_year & str_short_day & str_short_month & ".zip", "E:\PrePaid_Data\TN\SFAF\"
Extract "E:\PrePaid_Data\TN\01_BAN_TN_ADJM_20090528.txt.zip", "E:\PrePaid_Data\TN"
Sub Extract( ByVal myZipFile, ByVal myTargetDir )
Dim intOptions, objShell, objSource, objTarget
Set objShell = CreateObject( "Shell.Application" )
Set objSource = objShell.NameSpace( myZipFile ).Items( )
Set objTarget = objShell.NameSpace( myTargetDir )
Set colItems = objFolder.Items
intOptions = 256
objTarget.CopyHere objSource, intOptions
Set objSource = Nothing
Set objTarget = Nothing
Set objShell = Nothing
End Sub
ndate = date()
ndate = ndate-0
strlongdate = formatdatetime(ndate,vblongdate)
strshortdate = formatdatetime(ndate,vbshortdate)
'wsh.echo "The yesterday date is : " & cstr(ndate)
'wsh.echo "The long date : " & strlongdate
'wsh.echo "The short date : " & strshortdate
strshortdatearray = split(strshortdate,"/")
'wsh.echo cstr(strshortdatearray(0))
'wsh.echo cstr(strshortdatearray(1))
'wsh.echo cstr(strshortdatearray(2))
'**********Set these values accordingly to the date format of the machine (2008-01-01)***********
str_short_year = cstr(strshortdatearray(2))
str_short_month = cstr(strshortdatearray(1))
str_short_day = cstr(strshortdatearray(0))
if len(str_short_day ) = 1 then
str_short_day = "0" & str_short_day
end if
if len(str_short_month ) = 1 then
str_short_month = "0" & str_short_month
end if
Option Explicit
'Extract "E:\PrePaid_Data\TN\SFAF\08_BAN_TN_SFAF_" & str_short_year & str_short_day & str_short_month & ".zip", "E:\PrePaid_Data\TN\SFAF\"
Extract "E:\PrePaid_Data\TN\01_BAN_TN_ADJM_20090528.txt.zip", "E:\PrePaid_Data\TN"
Sub Extract( ByVal myZipFile, ByVal myTargetDir )
Dim intOptions, objShell, objSource, objTarget
Set objShell = CreateObject( "Shell.Application" )
Set objSource = objShell.NameSpace( myZipFile ).Items( )
Set objTarget = objShell.NameSpace( myTargetDir )
Set colItems = objFolder.Items
intOptions = 256
objTarget.CopyHere objSource, intOptions
Set objSource = Nothing
Set objTarget = Nothing
Set objShell = Nothing
End Sub
ndate = date()
ndate = ndate-0
strlongdate = formatdatetime(ndate,vblongdate)
strshortdate = formatdatetime(ndate,vbshortdate)
'wsh.echo "The yesterday date is : " & cstr(ndate)
'wsh.echo "The long date : " & strlongdate
'wsh.echo "The short date : " & strshortdate
strshortdatearray = split(strshortdate,"/")
'wsh.echo cstr(strshortdatearray(0))
'wsh.echo cstr(strshortdatearray(1))
'wsh.echo cstr(strshortdatearray(2))
'**********Set these values accordingly to the date format of the machine (2008-01-01)***********
str_short_year = cstr(strshortdatearray(2))
str_short_month = cstr(strshortdatearray(1))
str_short_day = cstr(strshortdatearray(0))
if len(str_short_day ) = 1 then
str_short_day = "0" & str_short_day
end if
if len(str_short_month ) = 1 then
str_short_month = "0" & str_short_month
end if
Option Explicit
'Extract "E:\PrePaid_Data\TN\SFAF\08_BAN_TN_SFAF_" & str_short_year & str_short_day & str_short_month & ".zip", "E:\PrePaid_Data\TN\SFAF\"
Extract "E:\PrePaid_Data\TN\01_BAN_TN_ADJM_20090528.txt.zip", "E:\PrePaid_Data\TN"
Sub Extract( ByVal myZipFile, ByVal myTargetDir )
Dim intOptions, objShell, objSource, objTarget
Set objShell = CreateObject( "Shell.Application" )
Set objSource = objShell.NameSpace( myZipFile ).Items( )
Set objTarget = objShell.NameSpace( myTargetDir )
Set colItems = objFolder.Items
intOptions = 256
objTarget.CopyHere objSource, intOptions
Set objSource = Nothing
Set objTarget = Nothing
Set objShell = Nothing
End Sub
Resolve Any ONE ASAP............................