I've just joined the forum and have found it very helpful! Thank you!
I'm new to VB.net and programming in general - my background is general analysis and research in banking, so please bear with me.
I'm trying to call a batch file with SHELL that includes 2 parameters in VB.net. The batch file works just fine on its own when called with a shortcut on the desktop.
What appears to happens in VB.net is that the parameters are enclosed in the double quote string in the Shell.
This is what works in the shortcut on the desktop:
"C:\Program Files\lending\convert.bat" daily review
(daily and review are the 2 parameters that are passed to %1 and %2 in the bat file)
This is what I have in VB.net:
Dim strPath As String = "C:\Program Files\lending\"
Dim strApp As string = "convert.bat"
Dim sCmdLine As String
sCmdLine = strPath & strApp & " daily review"
Call Shell(sCmdLine, AppWinStyle.NormalFocus)
The value of sCmdLine is:
"C:\Program Files\lending\convert.bat daily review"
Is it possible to have the "value" of sCmdLine as:
"C:\Program Files\lending\convert.bat" daily review
Right now when I run the app, the command window appears to launch, but the .bat file doesn't appear to run, which leads me to believe that Shell can't "find the file".
Any insight would be helpful!
Call Shell(sCmdLine, AppWinStyle.NormalFocus)
I'm new to VB.net and programming in general - my background is general analysis and research in banking, so please bear with me.
I'm trying to call a batch file with SHELL that includes 2 parameters in VB.net. The batch file works just fine on its own when called with a shortcut on the desktop.
What appears to happens in VB.net is that the parameters are enclosed in the double quote string in the Shell.
This is what works in the shortcut on the desktop:
"C:\Program Files\lending\convert.bat" daily review
(daily and review are the 2 parameters that are passed to %1 and %2 in the bat file)
This is what I have in VB.net:
Dim strPath As String = "C:\Program Files\lending\"
Dim strApp As string = "convert.bat"
Dim sCmdLine As String
sCmdLine = strPath & strApp & " daily review"
Call Shell(sCmdLine, AppWinStyle.NormalFocus)
The value of sCmdLine is:
"C:\Program Files\lending\convert.bat daily review"
Is it possible to have the "value" of sCmdLine as:
"C:\Program Files\lending\convert.bat" daily review
Right now when I run the app, the command window appears to launch, but the .bat file doesn't appear to run, which leads me to believe that Shell can't "find the file".
Any insight would be helpful!
Call Shell(sCmdLine, AppWinStyle.NormalFocus)