Welcome !
         

 Auto Import Script not Working

Author Message
babanash

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 11/27/2016
  • Status: offline
Auto Import Script not Working Sunday, November 27, 2016 11:56 AM (permalink)
0
Hi all,

I'm an absolute beginner with VB hence I might ask some silly questions.
I have a VB script getting triggered via a Batch file which resulots in data being imported for last day.
Below is the code for VB and Batch file.
Please let me know if you see any error in the code.

VB Script
 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 > 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" & Dy  If Len(Mth) = 1 Then Mth = "0" & Mth  ImportStartDate = Dy & "/" & Mth & "/" & Year(ImportDate)   rem Prepare import script to run (not useed yet) rem oFile.WriteLine("isps_ul.exe -t -d " & todaydate & " -L 1")  rem oFile.Close  rem Run XLink import  wscript.echo "isps_ul.exe -t -d " & ImportStartDate & " -L " & ImportedNumberOfDays oShell.Run "isps_ul.exe -t -d " & ImportStartDate & " -L " & ImportedNumberOfDays, 1, true 
 
 Batch File
   
 @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 
  
 



 
#1
    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2017 ASPPlayground.NET Forum Version 3.9