You are not logged in.
Pages: 1
Hi,
I have a batch fille that starts all my Programs that I need (7), I was very happy with it until i tried the same in VB
Cmd to start program (minimized)
@echo off
start "" /min "C:\Windows\system32\dsac.exe"
VB Script to start Program
strProgramPath = """C:\Windows\system32\dsac.exe"""
SET objShell = CREATEOBJECT("Wscript.Shell")
objShell.Run strProgramPath
The VB script seems to do the job faster but is there a way to make it look a bit better than repating that 7 times with different path in each one?
I'm also looking for a way to control the minimum, maximised state (as per the cmd above) via the VB.
Thanks for taking the time...
T.
Offline
I kinda doubt you will see any noticeable performance difference between launching with CMD vs VBS, you may just be seeing the affect of disc caching.
A different approach is to put all the paths in a single shortcut:
set the Target to
cmd /c start "" /min "C:\Windows\system32\dsac.exe" & start "" /min Write.exe & start "" /min SomeOtherProgram.exe
Offline
Hi,
is there a way to make it look a bit better than repating that 7 times with different path in each one?
I'm also looking for a way to control the minimum, maximised state (as per the cmd above) via the VB.Thanks for taking the time...
T.
Won't be much useful. Basically what I have understood that you want to run all 7 commands ( programs) in one line. If I got it right then there are many ways that you can do it; but each way command will be repeate 7 times. It may be repeated by your main code, sub-code or interpreter ( as Simon's example) or even another executable.
Different paths cannot be made to work usually with interpreters ; as they are different they haver to be specified differently.
I would declare an array in vbscript and iterate with for loop.
Startup states are controlled by using intWindowStyle. http://ss64.com/vb/run.html.
Do you have any problem with shell.run ; it is perfect.
I do agree with you that vbscript executions are faster; whatever reson may be.
Regards
Sarbjit Singh Gill
IBM certified DBA, MQ Solution Developer
Offline
If you want to run something hidden from the taskbar input this into a VBS file:
CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False
Then you need a batch file to run the two, the VBSscript and the program/application so input this into batch:
wscript.exe "%userprofile%\desktop\hidden.vbs" "Application.exe"
To run it, just simply start the batch file you made for it.
Offline
Pages: 1