Auto Import Script not Working
<p>I'm an absolute beginner with VB hence I might ask some silly questions.<br>
I have a VB script getting triggered via a Batch file which results in data being imported for last day.
Below is the code for VB and Batch file.<br>
Please let me know if you see any error in the code.</p>

<p><strong>VB Script</strong></p>

<pre><code>rem 
rem XLink_Import.vbs
rem 

Set oShell = WScript.CreateObject("WScript.Shell") 

' filename = oShell.ExpandEnvironmentStrings("today_xlink.bat") 
' Set objFileSystem = CreateObject("Scripting.fileSystemObject") 
' Set oFile = objFileSystem.CreateTextFile(filename, TRUE) 

Dim i
Dim ImportStartOffset, ImportedNumberOfDays

If WScript.Arguments.length &gt; 0 Then
    For i=0 to WScript.Arguments.length-1
        Arg = WScript.Arguments(i)
        If Left(Arg,1) = "-" Then
            If ( Arg = "-o" ) Then
                ImportStartOffset = WScript.Arguments(i+1) 
            End if
            If ( Arg = "-n" or Arg = "-l" ) Then
                ImportedNumberOfDays = WScript.Arguments(i+1) 
            End if
        End if
    Next
End If

rem Prepare the import start date

Dim Dy, Mth
Dim ImportDate
ImportDate = Now + ImportStartOffset
Dy = Day(ImportDate) 
Mth = Month(ImportDate) 
If Len(Dy) = 1 Then Dy = "0" &amp; Dy 
If Len(Mth) = 1 Then Mth = "0" &amp; Mth 
ImportStartDate = Dy &amp; "/" &amp; Mth &amp; "/" &amp; Year(ImportDate) 

rem Prepare import script to run (not useed yet)
rem oFile.WriteLine("isps_ul.exe -t -d " &amp; todaydate &amp; " -L 1") 
rem oFile.Close

rem Run XLink import

wscript.echo "isps_ul.exe -t -d " &amp; ImportStartDate &amp; " -L " &amp; ImportedNumberOfDays
oShell.Run "isps_ul.exe -t -d " &amp; ImportStartDate &amp; " -L " &amp; ImportedNumberOfDays, 1, true
</code></pre>

<p><strong>Batch File</strong></p>

<pre><code>@echo off
rem
rem XLink_Import.bat
rem
rem Manually starts an Xlink import starting today + a StartOffset of some days. 
rem Imported number of days can also be set.
rem

set ImportStartOffset=0
set ImportedNumberOfDays=1

cscript XLink_Import.vbs -o %ImportStartOffset% -n %ImportedNumberOfDays%

pause
</code></pre>