No announcement yet.

Changing vbscript to disable FTP

  • Filter
  • Time
  • Show
Clear All
new posts

  • Changing vbscript to disable FTP

    We use the following script to run a VB script:
    :: Script Name:  GetNaverusANP.cmd
    :: Copyright 2004 Naverus, Inc.  All rights reservered
    :: GetNaverusANP.cmd is a Windows command file used to launch the FTPANP.Vbs script.
    :: This command file can be used with the Windows Scheduler.
    :: Usage: GetNaverusANP ^<filename to get^> ^<destination dir^>
    :: This script logs its results to c:\naverus\logs
    if "%1" =="" goto Usage
    if "%2" =="" goto Usage
    :: ***  Set Script Variables ***
    Set Ver=1.1
    Set NavPath=D:\SDMAPP\naverus
    Set ANPPath=D:\SDMAPP\naverus\cmdutils
    Set ANPLogfile=%1_ftpanp_log.txt
    Set PutLogfile=ftp_put_log.txt
    Set LogPath=D:\SDMAPP\naverus\logs
    Set ANPLog=%LogPath%\%ANPLogfile%
    Set PUTLog= %LogPath%\%PutLogfile%
    Set Results=%2results
    If Not Exist %NavPath% (goto Errorpath)
    If Not Exist %LogPath% (mkdir %LogPath%)
    echo -------------------------------------------------------------------------------------- > %ANPLog%
    echo GetNaverusANP v.%ver% started at %DATE% %TIME% >> %ANPLog%
    echo -------------------------------------------------------------------------------------- >> %ANPLog%
    c:\windows\system32\cscript.exe %ANPPath%\ftpanp.vbs %1 %2 >> %ANPLog%
    echo crc results follows >> %ANPLog%
    type %Results%\*crc.csv >> %ANPLog%
    echo ************************************************************************************** >> %ANPLog%
    echo GetNaverusANP completed at %DATE% %TIME% >> %ANPLog%
    echo ************************************************************************************** >> %ANPLog%
    ::c:\windows\system32\cscript.exe %ANPPath%\putfile.vbs %ANPLog% > %PutLog%
    goto eof
    echo Usage: GetNaverusANP ^<filename to get^> ^<destination dir^>
    echo Runs FTPANP.vbs to pull ANP files from Naverus Servers.
    echo Note: Destination directory must contain trailing slash!!!
    echo Example: GetNaverusANP c:\temp\
    echo Wrong Path, unable to find %NAVPath%
    goto eof
    See attached txt file for the VBscript

    We no longer use the FTP part of the script to fetch the file, the file is delivered to D:\SDMPAPP\Naverus\Output

    I've tried my best to disable the sections referring to the SFTP part of the script, but when I run the script, I am still getting errors:
    (see attached file)

    I am no expert at VB Script, what am I doing wrong?
    Last edited by krokkie; 18th March 2014, 21:53.

  • #2
    Re: Changing vbscript to disable FTP

    you have comment out the lines 82 and 83
    'Dim fso
    'Set fso=CreateObject("Scripting.FilesystemObject")
    you have not comment out the lines 275 - 284
    If fso.FileExists(DestFilePath & Filetoget)=true Then
    	strnewfile=filetoget &".lkg"
         	fso.MoveFile DestFilePath & Filetoget, DestFilePath & strnewfile
    		If Err.Number <> 0 Then
         	    strMsg="Error moving file "& strnewfile
    			Wscript.Quit 1
    			End If
         	WScript.Sleep 1000 
    End If
    the error showed in the screen shot is:
    ftpanp.vbs (line: 275, position: 1) Microsoft runtime error: object required: 'fso'
    Because you have disabled the lines where the object was defined (set fso=).


    This posting is provided "AS IS" with no warranties, and confers no rights.


    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts


    • #3
      Re: Changing vbscript to disable FTP

      Thank you very much.

      I've iuncommented lione 83&84, and the script is working as expected.