on start up i have a bat file run routine things for me
开发者_如何学JAVAhowever, the black console pops up and stays open until everything is finished....
anyway to hide it and run it in background ? so it shouldn't appear minimized or system tray.
You can use a VBS script to achieve this. Either write all your code as VBS, or call your batch file like this:
'launch.vbs
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "mybatch.bat", 0
WshShell = Null
Create a shortcut to the file. On the new shortcut: Right click -> Properties. Go to the Shortcut tab, and choose "Run: Minimized." (This is assuming you're on WinXP).
This link should help you as helped me. I used the second solution that uses a program named quiet.exe
To use, just call quiet.exe program params_if_has
.
My use example: quiet.exe php script.php
You can't really do that but if you are using the scheduler to run the batch file you can select "don't interact with desktop" when creating the job.
I once had a little program which could hide windows based on their title. So my startup batch first set a unique title with title
and then called the other program to hide the window with said title. Worked fine but involves a little programming.
If you don't want to go that way, then you should use the Task Scheduler as tr4656 noted.
Try renaming your file to .cmd
instead of .bat
.
Or, if you're executing a .exe
try:
start "" "C:\Program Files\SomeProg\someprog.exe"
Note: When using "start" you have to be at a command prompt.
精彩评论