newbie min cmd window?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Nicodemus
Posts: 9
Joined: 22 Feb 2019 12:58

newbie min cmd window?

#1 Post by Nicodemus » 22 Feb 2019 13:03

how do I run the cmd window hidden or min?

Code: Select all

@echo off
"E:\12noon Display Changer\dc64.exe" -width=1176 -height=664 /c "E:\LaunchBox\Games\Big Fish Games\Mystery Case Files - Return to Ravenhearst FINAL\ReturnToRavenhearst.exe"
im running a game at a custom resolution with Display Changer, however the cmd window is visible behind it?
thanks for your help

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: newbie min cmd window?

#2 Post by Squashman » 22 Feb 2019 13:08

Code: Select all

@echo off
start "My Game" "E:\12noon Display Changer\dc64.exe" -width=1176 -height=664 /c "E:\LaunchBox\Games\Big Fish Games\Mystery Case Files - Return to Ravenhearst FINAL\ReturnToRavenhearst.exe"

Nicodemus
Posts: 9
Joined: 22 Feb 2019 12:58

Re: newbie min cmd window?

#3 Post by Nicodemus » 22 Feb 2019 15:32

Thank you VERY much! one last question. Can I add a .exe program to start the same time? I have a program called Blackie that will black out everything in the background.
im trying to get the game to play in windowed mode but with a black background and not the desktop.
im running Desktop Changer to switch the resolution, then running the game, then running Blackie to black out the desktop.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: newbie min cmd window?

#4 Post by Squashman » 22 Feb 2019 15:59

I am not going to make assumptions on what code you are using to accomplish your task. It is pointless to ask a question if you haven't already tried some code to solve the task.

Try to code it yourself. If it doesn't work, come back and post the code you are trying to use and explain in full detail what you are trying to accomplish.

Nicodemus
Posts: 9
Joined: 22 Feb 2019 12:58

Re: newbie min cmd window?

#5 Post by Nicodemus » 22 Feb 2019 16:30

thank you

@echo off

start "my game" "E:\12noon Display Changer\dc64.exe" -width=1280 -height=720 /c "E:\LaunchBox\Games\Big Fish Games\Mystery Case Files - Return to Ravenhearst FINAL\ReturnToRavenhearst.exe"

"E:\LaunchBox\Games\Big Fish Games\Launchers\Blackie.exe"

taskkill /IM ReturnToRavenhearst.exe

when ReturnToRavenhearst.exe closes I want Blackie.exe to close with it. sorry, im 13 and still learning this.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: newbie min cmd window?

#6 Post by Ed Dyreen » 22 Feb 2019 17:14

This may work, in the worst case the script will respond after 9 pings, script requires system to have a network driver installed or it will clog the CPU.

Code: Select all

@echo off

start "my game" "E:\12noon Display Changer\dc64.exe" -width=1280 -height=720 /c "E:\LaunchBox\Games\Big Fish Games\Mystery Case Files - Return to Ravenhearst FINAL\ReturnToRavenhearst.exe"

start "" "E:\LaunchBox\Games\Big Fish Games\Launchers\Blackie.exe"

for /L %%i in () do (

	for /L %%i in (1,1,9) do 2>nul>&1 ping;
	
	2>nul>&1 taskList /NH /FI "imagename EQ ReturnToRavenhearst.exe" ||(

		taskkill /IM Blackie.exe
		exit 0
	)
)
If possible to start ReturnToRavenhearst.exe after blackie.exe then the coding can be simple.

Code: Select all

@echo off

start "" "E:\LaunchBox\Games\Big Fish Games\Launchers\Blackie.exe"

start "my game" /WAIT "E:\12noon Display Changer\dc64.exe" -width=1280 -height=720 /c "E:\LaunchBox\Games\Big Fish Games\Mystery Case Files - Return to Ravenhearst FINAL\ReturnToRavenhearst.exe"

taskkill /IM Blackie.exe

exit 0

Nicodemus
Posts: 9
Joined: 22 Feb 2019 12:58

Re: newbie min cmd window?

#7 Post by Nicodemus » 22 Feb 2019 17:41

omg! the 2nd script worked. I see what I was doing wrong. thank you

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: newbie min cmd window?

#8 Post by Squashman » 22 Feb 2019 18:45

But I thought the problem was you didn't want the cmd window open in the background. I don't see how this solves that.

Nicodemus
Posts: 9
Joined: 22 Feb 2019 12:58

Re: newbie min cmd window?

#9 Post by Nicodemus » 22 Feb 2019 19:23

your right it doesn't. but im still trying different things.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: newbie min cmd window?

#10 Post by Ed Dyreen » 22 Feb 2019 19:38

Nicodemus wrote:
22 Feb 2019 19:23
your right it doesn't. but im still trying different things.
my mistake :)

startMinimized.CMD

Code: Select all

start "" /MIN "startGame.CMD"
startGame.CMD will start minimized in there you put the actual code.
Nicodemus wrote:
22 Feb 2019 19:23
omg! the 2nd script worked. I see what I was doing wrong. thank you
I tested the first script on my pc, but I can't reproduce the problem "not works" :|

Nicodemus
Posts: 9
Joined: 22 Feb 2019 12:58

Re: newbie min cmd window?

#11 Post by Nicodemus » 22 Feb 2019 20:20

like this?
@echo off

start "" /MIN "startGame.CMD"@echo off

start "" "E:\LaunchBox\Games\Big Fish Games\Launchers\Blackie.exe"

start "" /WAIT "E:\12noon Display Changer\dc64.exe" -width=1280 -height=720 /c "E:\LaunchBox\Games\Big Fish Games\Mystery Case Files - Return to Ravenhearst FINAL\ReturnToRavenhearst.exe"

taskkill /IM Blackie.exe

exit 0

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: newbie min cmd window?

#12 Post by Ed Dyreen » 22 Feb 2019 21:30

Eh no, more like in 2 separate files

startMinimized.CMD

Code: Select all

start "" /MIN "startGame.CMD"
startGame.CMD

Code: Select all

@echo off
start "" "E:\LaunchBox\Games\Big Fish Games\Launchers\Blackie.exe"
start "my game" /WAIT "E:\12noon Display Changer\dc64.exe" -width=1280 -height=720 /c "E:\LaunchBox\Games\Big Fish Games\Mystery Case Files - Return to Ravenhearst FINAL\ReturnToRavenhearst.exe"
taskkill /IM Blackie.exe
exit 0
And then run startMinimized.CMD

Nicodemus
Posts: 9
Joined: 22 Feb 2019 12:58

Re: newbie min cmd window?

#13 Post by Nicodemus » 23 Feb 2019 07:05

thank you. I want to understand. I can use one cmd file to run another? also, they have to be separate files? thank you everyone for your help, I learned a lot. :D

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: newbie min cmd window?

#14 Post by Ed Dyreen » 23 Feb 2019 07:27

Nicodemus wrote:
23 Feb 2019 07:05
thank you. I want to understand. I can use one cmd file to run another? also, they have to be separate files? thank you everyone for your help, I learned a lot. :D
No they don't, actually I've been thinking a bit about your question because I was wondering if you preferred only a single batch.

Nicodemus
Posts: 9
Joined: 22 Feb 2019 12:58

Re: newbie min cmd window?

#15 Post by Nicodemus » 23 Feb 2019 08:42

thank you for your help. this works so im happy but I want to learn. how would I make it into a single batch file?

Post Reply