Solved Close batch script after being called


shoober420

Well-known member
Member
VIP
Local time
12:08 AM
Posts
231
OS
Windows 11 27965
im working around the 255 symbol limit MAX_PATH length when launching games from Steam using Properties < Launch Options. one way is to make a batch script and add the batch script directory path then %command% in the Steam game launch options.

Code:
"C:\Users\:USERNAME:\Downloads\game-configs-main\Counter-Strike 2\CS2LaunchOptions.bat" %command%


although this works, the batch script command prompt window stays open after the game launches. is there a way to have the command prompt close it launches the game?

ive tried adding "exit" and "exit /b" to the batch script and it still stays open

also using the LongPathsEnabled reg key to remove the 255 symbol limit for MAX_PATH lengths wont effect the launch options in Steam
 
Windows Build/Version
Windows 11 27934

My Computer

System One

  • OS
    Windows 11 27965
    Computer type
    PC/Desktop
    CPU
    Intel i7 7700 @4.0ghz
    Memory
    64gb DDR4
    Graphics Card(s)
    Radeon RX 5500 XT
    Sound Card
    Topping D50s
    Hard Drives
    NVMe
    PSU
    Corsair
    Keyboard
    Stelseries G6v2
    Mouse
    Zowie EC2
    Other Info
    https://www.youtube.com/shoober420
exit should work provided you launch the game with start
As in
Batch:
Start "C:\Path\To\Game.exe"
exit
 

My Computer

System One

  • OS
    Linux Mint
    Computer type
    Laptop
    Manufacturer/Model
    System76 Lemur Pro
The "start" is the key because your game needs to be running in the background for CMD to continue to the next line.

Some games use a launcher, which starts the game as another process and the launcher exits.
Some games just run until you exit it.
 

My Computer

System One

  • OS
    Windows 7
since its a Steam game, i have to use the game id to launch it. i got a working string, but this no longer requires me to launch the game from Steam and add launch options to it

CS2
Code:
start steam://rungameid/730 -vulkan -w 1600 -h 1200 -refresh 120 -refreshrate 120 -freq 120 -clientport 65007 -console -forcenovsync -fullscreen -limitvsconst -softparticlesdefaultoff -precachefontchars -noff -noforcemaccel -noforcemspd -nohltv -nojoy -nosteamcontroller -novid -preload -nodns -no-browser -noaafonts -nomsaa -noipx +mat_queue_mode 2 +exec autoexec.cfg

i also no longer needed the "%1" at the beginning. thanks guys!
 

My Computer

System One

  • OS
    Windows 11 27965
    Computer type
    PC/Desktop
    CPU
    Intel i7 7700 @4.0ghz
    Memory
    64gb DDR4
    Graphics Card(s)
    Radeon RX 5500 XT
    Sound Card
    Topping D50s
    Hard Drives
    NVMe
    PSU
    Corsair
    Keyboard
    Stelseries G6v2
    Mouse
    Zowie EC2
    Other Info
    https://www.youtube.com/shoober420

Latest Support Threads

Back
Top Bottom