Question:
Start .exe from D:\ in cmd (.bat) or start .lnk in cmd (.bat)?
2011-01-19 10:37:49 UTC
I installed CoD: Black Ops on a 2nd partition of my hard disk (D:\). I also have an Xbox 360 controller emulator that I run for my PS3 controller for the game. I am writing a .bat to open all of these up when I choose to.

Question 1: How can I, from my .bat, start an .exe from the install folder on D:?

< start "D:\Games\Call of Duty -Black Ops\BlackOps.exe" -- does not work

Question 2: If Question 1 is not possible or unknown, how can you start a shortcut (.lnk) from a .bat?

I have tried to find this answer anywhere I can, but have found nothing helpful. In this scenario I will have a shortcut somewhere on my C:. Also note that placing the shortcut in the root folder does not work either.

< start C:\path\to\shortcut\shortcut.lnk -- does not work
< start C:\path\to\shortcut\shortcut.exe.lnk -- does not work
< cd C:\path\to\shortcut
start shortcut.lnk -- does not work (nor shortcut.exe.lnk)
< rundll32 shell32.dll,ShellExec_RunDLL "shortcut.lnk" -- does not work (nor shortcut.exe.lnk)

Any help will be greatly appreciated. I hope someone out there knows a possible solution. Thank in advanced!

Samsung RF510-S02 laptop
WIN 7 Home Premium x64
Intel i7-720QM
4 Gb DDR3
NVIDIA GeForce 330M 1Gb
15.4-inch LED lid (1366 x 768)
640 Gb HDD (C:\ = 75 Gb, D:\ = 502 Gb)
WLAN BGN + BT 2.1 and BT 3.0
USB 3.0
Four answers:
PleaseInsertACoin
2011-01-19 10:40:18 UTC
Put

cd D:



At the top.
Project eXa
2011-01-19 10:44:07 UTC
take out the < starts



batch files are similar to how you would input on a command prompt....So the to start a .exe from folder d the bat would look like this



"D:\Games\Call of Duty -Black Ops\Blackops.exe"



thats it. make sure you have quotes around the entire thing, otherwise it will not work.
steve_loir
2011-01-19 10:41:17 UTC
In a BAT file you don't write "start".

Put in the commands as they are.

You can try them in the CMD window.



Just

D:\Games\Call of Duty -Black Ops\BlackOps.exe

will run the EXE.
2016-10-23 06:17:47 UTC
i've got no longer performed lots C in domicile windows, yet you will possibly be able to attempt fork, and exec the command interior the youngster technique. in straightforward terms a instruction manual of a diverse approach, I haven't any thought if it will make any difference.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...