possy_99 Posted May 14, 2005 Posted May 14, 2005 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 upMENU.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 romwhat I want it to do...MENU.CMD > GAMEx.CMD [hidden dos window? hold whilst emu running] >MENU.CMD
Yzöwl Posted May 14, 2005 Posted May 14, 2005 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.
possy_99 Posted May 14, 2005 Author Posted May 14, 2005 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'tI 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 @ /HIDstart /wait c:\install\emu.exe c:\install\rom.smscall menu.cmdso 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..
Yzöwl Posted May 14, 2005 Posted May 14, 2005 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 againI think you may be better off waiting until you have access to the batches and post the appropriate sections of them here for comment.
possy_99 Posted May 14, 2005 Author Posted May 14, 2005 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)..
Yzöwl Posted May 14, 2005 Posted May 14, 2005 regarding start /wait, theortically yes, although adding at least a blank title usually proves more effectivestart "" /wait
possy_99 Posted May 14, 2005 Author Posted May 14, 2005 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?
gunsmokingman Posted May 14, 2005 Posted May 14, 2005 You need the script to return to where it start from.Here is a example this from one of my old postso mod it to your needsTheLoop Is The start spot and the script returns back to there.echo offmode con: cols=55 lines=2title My App To Installcolor 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.Closestart /w Wscript.exe Exmple.vbsdel Exmple.vbscall Exmple.cmd ping -n 1 127.0.0.1>nul del Exmple.cmdgoto %Exmple%:Aclscolor 2bTitle Here Box 1echo Fill This Inping -n 3 127.0.0.1>nulgoto TheLoop:Bcolor 4fclscolor 2bTitle Here Box 2echo Fill This Inping -n 3 127.0.0.1>nulgoto TheLoop:Ccolor 9eclscolor 2bTitle Here Box 3echo Fill This Inping -n 3 127.0.0.1>nulgoto TheLoop:Quitecho Completedping -n 3 127.0.0.1>nulexit
possy_99 Posted May 14, 2005 Author Posted May 14, 2005 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.
gunsmokingman Posted May 14, 2005 Posted May 14, 2005 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.cmdTo test.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now