Win Help with BAT file creation
#1
I'm entirely new to the world of creating batch files. I've done some basic research but there area lot of commands out there and I thought it might be nice to ask you guys for help with elementary commands.

I'm aware of having to use "@echo" to start and end the program (though honestly I'm not sure why), and how to start a program. What I'd like to know is how to delay a program or set a time after which a program should open after the previous program, and how to start a program minimised or in the background.

Ultimately what I want to do is have my Windows 8 load XBMC and Steam when it boots up, but for Steam to be in the background (the reason I want it to pre-load and not just load when I launch it from Advanced Launcher is to cut out the part where I have to wait for Steam to sign-in before I can play a game!). At the moment what happens in the BAT file I've tried to create is that Steam loads first followed by XBMC, but as XBMC loads so much quicker, it's done before Steam gets a chance to finish, meaning that when Steam *does* finish, it comes to the front and obscures XBMC.

Any help would be much appreciated.
CPU: AMD Llano A6-3500 2.40GHz APU - MoBo: Gigabyte A75N-USB3 AMD A75 - RAM: Corsair Value 4GB DDR3 PC3-10666C9 1333MHz - Storage: 128GB SSD, 500GB HD - Case: Streacom FC7 Silver - ODD: Sony AD-7640S Slot Load DVD+RW Drive
Reply
#2
Instead of batch files, use autohotkey script. It is much easy. All you have to do is install autohotkey. Then right click the desktop or any location and create New>AutoHotkey script. Right click the file so created and select the option Edit. Add the following commands by referring to the correct file path:

Code:
run, c:\program files\steam\steam.exe, , min ; run steam.exe minimized
sleep 10000 ; wait 10 seconds.
run, c:\program files\xbmc\xbmc.exe ; run xbmc.exe
Sleep, 5000
WinActivate, ahk_class XBMC ; bring xbmc to front.

Save and double click the file to run the script. Alternately you can create an exe file by compiling the script.
Reply
#3
Many thanks baijuxavior! I was trying the BAT method as I'd rather not have to have AutoHotkey open to achieve what I want to achieve, so a compiled exe sounds perfect!
CPU: AMD Llano A6-3500 2.40GHz APU - MoBo: Gigabyte A75N-USB3 AMD A75 - RAM: Corsair Value 4GB DDR3 PC3-10666C9 1333MHz - Storage: 128GB SSD, 500GB HD - Case: Streacom FC7 Silver - ODD: Sony AD-7640S Slot Load DVD+RW Drive
Reply

Logout Mark Read Team Forum Stats Members Help
Help with BAT file creation0