Notepad converted into a batch file does not want to execute a command.

Owldude

Reputable
Nov 15, 2016
39
0
4,530
So I want to mess around with Half-Life speedrunning but in-order to do so I need to make a batch file with notepad and execute a command. The command is the following:

"D:\Games & Downloads\GoldSrc Package 2.1\Bunnymod XT\Injector.exe" D:\Games & Downloads\GoldSrc Package 2.1\Half-Life\hl.exe -game valve_WON -noforcemparms +map c1a0
"D:\Games & Downloads\GoldSrc Package 2.1\RInput\RInput.exe" hl.exe

Every time I try to launch my game with the bat file I get this: Error creating process: access is denied. I searched around on other forums but to no avail.
 
Solution
D:
cd \Games & Downloads\GoldSrc Package 2.1\
"Bunnymod XT\Injector.exe" Half-Life\hl.exe -game valve_WON -noforcemparms +map c1a0
RInput\RInput.exe Half-Life\hl.exe

Your script is wrong in several ways.

You have items with spaces which would need to be in quotes
ie: D:\Games & Downloads\GoldSrc Package 2.1\Half-Life\hl.exe
there is a space between several items making the entire line gibberish as the PC will try to interpt "D:\games" "&" and so on as seperate shell commands.

You refer to items in a different tree with out given the absolute or relative path to it.
ie:"D:\Games & Downloads\GoldSrc Package 2.1\RInput\RInput.exe" hl.exe
How is RIput supposed to know where HL.exe is?

Owldude

Reputable
Nov 15, 2016
39
0
4,530


I've already tried this and it is the same error.
 
D:
cd \Games & Downloads\GoldSrc Package 2.1\
"Bunnymod XT\Injector.exe" Half-Life\hl.exe -game valve_WON -noforcemparms +map c1a0
RInput\RInput.exe Half-Life\hl.exe

Your script is wrong in several ways.

You have items with spaces which would need to be in quotes
ie: D:\Games & Downloads\GoldSrc Package 2.1\Half-Life\hl.exe
there is a space between several items making the entire line gibberish as the PC will try to interpt "D:\games" "&" and so on as seperate shell commands.

You refer to items in a different tree with out given the absolute or relative path to it.
ie:"D:\Games & Downloads\GoldSrc Package 2.1\RInput\RInput.exe" hl.exe
How is RIput supposed to know where HL.exe is?
 
Solution

Eximo

Titan
Ambassador
That second path should also be in quotes. Computers don't like spaces in strings.

Another common thing to do is to test your commands from a command prompt. If they don't work there, usually a starting point.

You could also try a powershell script.

Or a VB script launching a command prompt.

Or cramming all of that into a shortcut.
 

Owldude

Reputable
Nov 15, 2016
39
0
4,530


Thanks a lot bjornl! You showed me my mistake. It was because of the "&" part it really did ruin everything.
 

TRENDING THREADS