I have created a batch file(.bat file). I am not sure, due to some reasons its not running when i double click on it. i would like to use a vb script instead of batch file. here is the batch file i am using.

REM ach-rec.bat
REM RECEIVES FILE FROM HP-UX
@echo off

REM SEND TODAY'S FILE
cd c:\progra~1\Putty\
echo open 192.168.0.10 >> temp.tmp
echo cd /var/summit/spectrum/LIVE/FI/DATA >> temp.tmp
echo get DACHORIG C:\Ach_recv\DACHORIG >> temp.tmp

psftp -b temp.tmp
erase temp.tmp

 

any help would be greatly appreciated.

 

thanks

 

alex

 

 

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

2

The easiest way to troubleshoot Batch files on Windows 7 is to call them while running Command Prompt as Administrator.  Also, placing pauses in between lines to verify your lines are being called properly and not erroring.

VB Script has many methods you could try to achieve this. 

Answered 12/31/2012 by: Trinity
Brown Belt

  • ok i finally got it to work but now i am trying to see if i can create a vb script instead
  • Are you looking to have something simple like calling the batch file in vb or entirely vbscript?
  • Simple VB Wrapping:
    Set objShell = CreateObject("Wscript.Shell")
    Result = objShell.Run("cmd /c "C:\BatchFile.bat"",0,True)
    If Result = 1 Then
    MsgBox "Error"
    Else
    MsgBox "SUCCESS!"
    End If
    Set objShell = Nothing
Please log in to comment

Answers

-1

do you guys know if there is a way to create a vb scrip to accomplish the same thing i am trying to do in the batch file

Answered 12/31/2012 by: brighstarcuit
Seventh Degree Black Belt

Please log in to comment
Answer this question or Comment on this question for clarity