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
Answers (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