| | |
Pass a text file through a batch file
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2008
Posts: 3
Reputation:
Solved Threads: 0
Hi
I run a batch file by VB6. The bach file need to pass a text file and a string (such as abc).
I used the following commands but I faced errors :
Shell "n:\aa.bat " & "c:\a1.txt" & "abc " , vbNormalFocus
Shell "n:\aa.bat " & " " & "c:\a1.txt" & " " & "abc" , vbNormalFocus
What is the command for doing that?
I run a batch file by VB6. The bach file need to pass a text file and a string (such as abc).
I used the following commands but I faced errors :
Shell "n:\aa.bat " & "c:\a1.txt" & "abc " , vbNormalFocus
Shell "n:\aa.bat " & " " & "c:\a1.txt" & " " & "abc" , vbNormalFocus
What is the command for doing that?
Last edited by hamidreza2790; Nov 4th, 2008 at 6:49 am.
I'm not sure on what you are after. Do you require
1.) the instructions on how to accept the inputs with the batch file
Any arguments for the batch file are saved as % then a number. The first argument is always %1, the second is %2, the third is %3 etc
or
2.)How to add the batch file arguments on the end of the line while in VB?
I added this line in VB
and that worked fine
1.) the instructions on how to accept the inputs with the batch file
Any arguments for the batch file are saved as % then a number. The first argument is always %1, the second is %2, the third is %3 etc
or
2.)How to add the batch file arguments on the end of the line while in VB?
I added this line in VB
VB Syntax (Toggle Plain Text)
Call Shell("c:\test.bat" & " " & "one two tree", vbNormalFocus)
and that worked fine
Last edited by bushman_222; Nov 4th, 2008 at 11:37 am.
•
•
Join Date: Nov 2008
Posts: 3
Reputation:
Solved Threads: 0
thank you very much for your attention
The batch file that I use, need to pass a text file.
In the ther other word after running batch file , the path of input data file (text file) should be entered.
I used the following command but It just run the batch file without reading data file.
Call Shell("c:\test.bat" & " " & "c:\x1.dat", vbNormalFocus)
What would be the command to run a batch file and read data file?
The batch file that I use, need to pass a text file.
In the ther other word after running batch file , the path of input data file (text file) should be entered.
I used the following command but It just run the batch file without reading data file.
Call Shell("c:\test.bat" & " " & "c:\x1.dat", vbNormalFocus)
What would be the command to run a batch file and read data file?
Last edited by hamidreza2790; Nov 4th, 2008 at 12:54 pm.
![]() |
Similar Threads
- Calling external files (C++)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: auto increment number/id
- Next Thread: code to delete *.tmp file in vb6
Views: 1738 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 2007 access activex add age append application basic beginner birth bmp c++ calculator cd click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





