/build/static/layout/Breadcrumb_cap_w.png

help with batch file in windows 7

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

Answers (2)

Posted by: Trinity 11 years ago
Brown Belt
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. 


Comments:
  • ok i finally got it to work but now i am trying to see if i can create a vb script instead - brighstarcuit 11 years ago
  • Are you looking to have something simple like calling the batch file in vb or entirely vbscript? - Trinity 11 years ago
  • 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 - Trinity 11 years ago
Posted by: brighstarcuit 11 years ago
7th Degree Black Belt
-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

 
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