Jump to content

Recommended Posts

Posted

I'm in the process of making an unattended xp install which lets you play sonic whilst xp is installing. I added the deatched program parameter to winnt.sif calling a cmd file I made giving a choice of games, depending on the choice, another cmd file is called which has cmdow @ /HID option, this loads the emulator and the rom.

At the moment, it goes well, the menu automaticlly appears at t-39, dissapears when you make your selection (this is quite handy as you can then see the timer counting down the install process) and the elumator and rom are loaded fine.

What I want though is for the menu batch file to come back up once the emulator is closed, just leaving the menu open blocks the timer. I have tried the start /wait option, but that doesn't seem to be helping. At the moment, when you close the emulator, the menu does not come back up

MENU.CMD -> batch file giving choice of game - loads gamex.cmd depending on choice

GAMEx.CMD -> batch containing command line parameters to run emu and load rom

what I want it to do...

MENU.CMD > GAMEx.CMD [hidden dos window? hold whilst emu running] >MENU.CMD


Posted

I'm not sure if I fully understand but I think that you are running MENU.CMD which upon choosing the option runs GAMEx.CMD, when finished with the game, you want to return to MENU.CMD.

You will therefore probably use CALL GAME.CMD from MENU.CMD in order to run the the GAME, then leave GAME.CMD open during the game, with PAUSE, or a timer countdown. When the game is finished, press any key to return to MENU.CMD, if you used PAUSE, or a simple GOTO :EOF after the timer countdown, if you choose that road.

Obviously this is all supposition, from my idea of what you meant, I hope it helps though.

Posted

yes, your right, I call the game.cmd batch from the menu batch (using call game.cmd) then, as cmdow is used, the game.cmd command window is hidden, the game loads fine. But, although the command is there to return to the menu, it doesn't

I don't have the files to hand as I'm on my friends computer, the game.cmd files go like this as far as I recall...

cmdow @ /HID

start /wait c:\install\emu.exe c:\install\rom.sms

call menu.cmd

so I thought this would return to the menu.cmd file once the emu has stopped (closed)... but it doesn't.. Idealy I don't want to have any command windows open during gameplay as it blocks the timer, I know it would be simple to move the window, but I think it would work best if I could keep the command window hidden, expect for the menu..

Posted

Since GAME.CMD was started from a CALL, it simply needs to GOTO :EOF to return to the MENU.CMD, you certainly shouldn't be calling MENU.CMD again

I think you may be better off waiting until you have access to the batches and post the appropriate sections of them here for comment.

Posted

hmm, well, I know the command which are executed depending on choice is just a basic call gamex.cmd command. I get the impression this is wrong though.

am I on the right track with thst start /wait thing though? should that pause the batch until the task (emu) has finished (or closed)..

Posted

regarding start /wait, theortically yes, although adding at least a blank title usually proves more effective

  • start "" /wait

Posted

ok, why's that though? not that I doubt your advice, but obviously I have more to learn, lol.

and.. am I right in thinking the call cmd in the gamex.cmd file doesn't need to be there? I'm not sure I following your advice properly in post #4, the way I'm interpreting is that when game.cmd is lcalled from menu.cmd, game.cmd will run and when finished, goes back and finishes menu.cmd - is that right?

Posted

You need the script to return to where it start from.

Here is a example this from one of my old post

so mod it to your needs

TheLoop Is The start spot and the script returns back to there.

echo off

mode con: cols=55 lines=2

title My App To Install

color f8

:TheLoop

> Exmple.vbs echo strUserIn = InputBox("Do you want to script / batch install basic apps"^& vbnewline ^&_

>> Exmple.vbs echo "Type A To Install Acrobat " ^& vbnewline ^& "Type B To Install Winzip" ^& vbnewline ^&_

>> Exmple.vbs echo "Type C To Install Office" ^& vbnewline ^& "Type Quit To Exit")

>> Exmple.vbs echo Set fs = CreateObject("Scripting.FileSystemObject")

>> Exmple.vbs echo strFileName = fs.BuildPath(Wscript.ScriptFullName ^& "\..", "Exmple.cmd")

>> Exmple.vbs echo strFileName = fs.GetAbsolutePathName(strFileName)

>> Exmple.vbs echo Set ts = fs.OpenTextFile(strFileName, 2, True)

>> Exmple.vbs echo ts.WriteLine "set Exmple=" ^& strUserIn

>> Exmple.vbs echo ts.Close

start /w Wscript.exe Exmple.vbs

del Exmple.vbs

call Exmple.cmd

ping -n 1 127.0.0.1>nul

del Exmple.cmd

goto %Exmple%

:A

cls

color 2b

Title Here Box 1

echo Fill This In

ping -n 3 127.0.0.1>nul

goto TheLoop

:B

color 4f

cls

color 2b

Title Here Box 2

echo Fill This In

ping -n 3 127.0.0.1>nul

goto TheLoop

:C

color 9e

cls

color 2b

Title Here Box 3

echo Fill This In

ping -n 3 127.0.0.1>nul

goto TheLoop

:Quit

echo Completed

ping -n 3 127.0.0.1>nul

exit

Posted

phew, that's a bit of a nightmare, lol.

I have added a loop to the menu.cmd, near the top I wrote :MENU, on any void choices, the loop works, then in choice parameters, I use goto Gamex and each game has it's repective :Gamex area where I use the call gamex.cmd command.

Posted

The script I posted works like this if i type in A then it goes to A and runs that part and return to TheLoop. If you type in quit then it will quit.

Just cut and paste the code and save as a ANY-NAME-YOU-WANT.cmd

To test. :thumbup

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...