Scripting Question

help with batch file in windows 7

12/31/2012 2440 views

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
@echo off

cd c:\progra~1\Putty\
echo open >> 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.







0 Comments   [ + ] Show comments


Community Chosen Answer


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"
    MsgBox "SUCCESS!"
    End If
    Set objShell = Nothing

All Answers


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
7th Degree Black Belt

This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ