View Full Version : Batch file
George Hallam
08-15-2007, 08:54 AM
i think its the right place windows
but anyway im no to good with batch files i want to make a small one to open a number programs at once. ie/ I-tunes and firefox. i no its simple enough to click the icons :p but i just want to know how to do it and put it to use.
i will put it all together but what are the commands i will have to use?
Forgive me im young :D:D George
Paul Komski
08-15-2007, 09:22 PM
Basically with .bat files in WinXP its start followed by the name of the executable (if the executable is in the system path) otherwise its the full path to the executable with no quotation marks but also with no spaces so you may need to contract to the 8dot3 short file-name.
Thus the following should fire up calculator, irfanview and notepad
start calc
start E:\Progra~1\IrfanView\i_view32.exe
start notepad
If you create .vbs files it is similar but the syntax is a little different and you can optionally add flags to open minimized=2, maximized=3 or restored=5 (and other flags). The File name or path must also not have any spaces but must be enclosed inside quotation marks.
Thus the following should fire up calculator, irfanview (minimized) and notepad (maximized)
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "calc"
WshShell.Run "E:\Progra~1\IrfanView\i_view32.exe", 2
WshShell.Run "notepad", 3
George Hallam
08-16-2007, 08:20 AM
ok thanks Paul
this is what i got
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "D:\Progra~1\Mozill~1\firefox.exe"
WshShell.Run "F:\Progra~1\N-tune\nTune\nTune\NVMonitor.exe"
WshShell.Run "F:\Progra~1\Azureus\Azureus.exe", 2
WshShell.Run "F:\Progra~1\Fraps\fraps.exe"
WshShell.Run "D:\Progra~1\ABIT\uGuru\uGuru.exe"
George Hallam
08-19-2007, 06:01 AM
i wanted to be more adventurous and came up with this it all work surprisingly apart from
start D:\Progra~1\Window~1\Messenger\msnmsgr.exe
that is were it is can you tell me were it went wrong
@echo off
echo Hello
pause
:start
ECHO.
ECHO 1. Run
ECHO 2. After BF2142
ECHO 3. Quit
set choice=
set /p choice= Make your chioce.
if '%choice%'=='1' goto Run
if '%choice%'=='2' goto After BF2142
if '%choice%'=='3' goto Quit
ECHO "%choice%" is not valid please try again
ECHO.
goto start
:Run
start D:\Progra~1\Mozill~1\firefox.exe
start F:\Progra~1\N-tune\nTune\nTune\NVMonitor.exe
start F:\Progra~1\Azureus\Azureus.exe
start F:\Progra~1\Fraps\fraps.exe
start D:\Progra~1\ABIT\uGuru\uGuru.exe
start F:\Progra~1\Logitec\SetPoint\KEM.exe
ECHO bye
pause
goto end
:After Bf2142
start D:\Progra~1\Mozill~1\firefox.exe
start F:\Progra~1\Azureus\Azureus.exe
start D:\Progra~1\Window~1\Messenger\msnmsgr.exe
ECHO bye
pause
goto end
:quit
goto end
forgive me im young, George :D:D
Paul Komski
08-19-2007, 07:09 AM
Just a guess but Messenger is not 8dot3
George Hallam
08-19-2007, 08:09 AM
how would i make it? i understand about progra~1 but messen~1 doesnt work??
Paul Komski
08-19-2007, 08:24 AM
There may be a conflict with other messen?????? names in the same folder. Alternatively the parent directory may be wrong with a number of folders stating Windows???????
From a command prompt in the relevant directory issuing
dir /x
should show all the actual 8dot3 or short names.
vBulletin v3.6.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.