i think these are command line arguments, im not sure:
prog1.exe /s /?
Id like to know how to code some into my program? Please leave a link that explains them and shows how to implement them.
thanks in advance chris1990
Printable View
i think these are command line arguments, im not sure:
prog1.exe /s /?
Id like to know how to code some into my program? Please leave a link that explains them and shows how to implement them.
thanks in advance chris1990
What specific arguments are you interested in?
I've read somewhere a few months ago that you can run parts of your code by using arguments. So parts of code in my program.
Yes, if you call your program from command prompt and you pass arguments as such:
prog1.exe argument
then the argument is automatically saved in vb as the constant variable: Command. So, if you want your msgbox.exe program to message whatever you type in as an argument then this would be the program:
vb Code:
Private Sub Form_Load() Dim sCmd As String sCmd = Command MsgBox sCmd Unload Me End Sub
My program is close.exe it has subs which include restart, log off, shutdown. I was hoping to run the subs in the program from another so i could use something likethis to restart the PC:
vb Code:
Shell "close.exe /restart"
Assume that this is your program
Then from a programCode:Option Explicit
Private Sub Form_Load()
CallByName Me, Command, VbMethod
End Sub
Public Sub restart()
MsgBox "restart"
End Sub
Public Sub shutdown()
MsgBox "shutdown"
End Sub
Shell "C:\temp\project1.exe restart"
or from Start|Run you could do
C:\temp\project1.exe restart
thanks