|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
** is this posible in VB6 ?? **I made a small program that needs to be scheduled to run every night. On some ocasions however the program must be used manualy to e.g. change the settings of for what ever reason. For this purpose the program has a graphical interface. The question Can I make a VB program with a startup parameter ?? e.g. start.exe /A the program runs in the background start.exe /B the program starts with the gui Any idea's ??? Greetings Farmer
Show quote
Hide quote
"farmer" <antwer***@hotmail.vom> wrote in message Look up the Command() function. It returns the command line parametersnews:081dl1htt3ccfdhn7h4t8sji297amrlotc@4ax.com... > Hello, > > > I made a small program that needs to be scheduled to run every night. > On some ocasions however the program must be used manualy to e.g. > change the settings of for what ever reason. For this purpose the > program has a graphical interface. > > > The question > > Can I make a VB program with a startup parameter ?? > > e.g. > > start.exe /A the program runs in the background > start.exe /B the program starts with the gui > > > > Any idea's ??? > > Greetings > > Farmer which must then be parsed by your program. Jim Edgar You could use the following code to get the command line options using the
Command Function. It only supports the space and Tab as separators. You can expand it if needed. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vafctcommandx.asp Or just press F1 in VB6 while the cursor is on "Command" and click on Example... > I made a small program that needs to be scheduled to run every night. You could use Task Scheduler to run your shortcut.Show quoteHide quote "farmer" <antwer***@hotmail.vom> wrote in message news:081dl1htt3ccfdhn7h4t8sji297amrlotc@4ax.com... > Hello, > > > I made a small program that needs to be scheduled to run every night. > On some ocasions however the program must be used manualy to e.g. > change the settings of for what ever reason. For this purpose the > program has a graphical interface. > > > The question > > Can I make a VB program with a startup parameter ?? > > e.g. > > start.exe /A the program runs in the background > start.exe /B the program starts with the gui > > > > Any idea's ??? > > Greetings > > Farmer > > > > > > > > > To pass arguments to your application you can use "Command"
I'm not exactly all possibillities but I know it works fine when using Sub Main() for starting an application, I assume it should work with Form_load too. "Command" is like a default variable that you can check at startup, ex. If Command = "A" then else endif Regards Kjell Show quoteHide quote "farmer" wrote: > Hello, > > > I made a small program that needs to be scheduled to run every night. > On some ocasions however the program must be used manualy to e.g. > change the settings of for what ever reason. For this purpose the > program has a graphical interface. > > > The question > > Can I make a VB program with a startup parameter ?? > > e.g. > > start.exe /A the program runs in the background > start.exe /B the program starts with the gui > > > > Any idea's ??? > > Greetings > > Farmer > > > > > > > > > > Hello everyone,
Thanks a milion for your tips and advice Works great, Greetings Farmer "farmer" <antwer***@hotmail.vom> wrote in message You've gotten the help you need in regards to command line parameters.news:081dl1htt3ccfdhn7h4t8sji297amrlotc@4ax.com... > Hello, > > > I made a small program that needs to be scheduled to run every night. > On some ocasions however the program must be used manualy to e.g. > change the settings of for what ever reason. I want to offer an additional comment/opinion..... Instead of having your app constantly running in the background for no real reason (other than to kick off what it must do presumably only once per night), use Task Scheduler to schedule your app to run at a certain time every night. If you do that, your app doesn't need to be always running just so that it can constantly be checking the time to see when it should perform this nightly task. If it were me, I'd have the program start with the GUI if there are no command line parameters. When set up in Task scheduler, include a command line parameter so the program knows to just "do its thing and quit". -- Mike Microsoft MVP Visual Basic
how to split numeric part from letters in string
Shrink Wrap Iterative GetObject get list of file names in a directory Is any device connected to COM1 port Division by Zero Error - Help Urgent InStr search counter Merge array in VB Odd sequencin of window display How to write a PDF file from Visual Basic ? |
|||||||||||||||||||||||