5 replies
by iainsheppard
Check out this knowledge base article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;171654 (Q171654)
You could probably alter this to suit your needs - the main thing to do is move the code from the Form_Load sub to your own main()sub maybe.
by mwest
To make an application that runs without user intervention or forms:
- Make a new standard project
- Remove the form that is placed there by default
- Add an empty Module
- Create a Sub Main in the module
- Set the project Startup object to "Sub Main", by going to Menu Project > Project1 Properties
- Check the "Unattended Execution" box (optional, will send any messages or actions that result in user interaction to an event log)
-------------------------------------------
Here is anexample of the sub Main:
Private Sub Main()
'Do whatever you want to to here
End Sub
Once you compile it, run your program and you will see that no interaction happens, it just executes on the background.
You may want to pass arguments to it. Any arguments passed to your program trhough the command line (E.g. cmdPrg.exe file01.dat) are stored in a system variable called "Command", so if you want to retrieve it, get the value of this variable.
E.g:
Dim Parameter as string
Parameter = Command
If you want to debug the program with command line arguments, set the argument value in the box called "Command line arguments" located in Project > Project1 Properties > Tab Make.
Thats all there is to it. If you have any problem, don't hesitate to write at:
juanr@akaconsulting.com
Good Luck!
by mwest
by mwest
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending