1

This batch file is supposed to assign a disc image file's path to the variable "game" then mount that image with a program call Daemon Tool's. Then a program called SSF is supposed to load the mounted disc image.

Unfortunately this batch file only loads the image that is already mounted. I am trying to understand each line in this file and I cannot find any help with the line.... set game= %1% .... I understand it is assigning a variable to game but what is the variable? Here is the batch file's contents. Thanks for any help you can provide.

@echo off
set game=%1% 
set daemon="C:\Program-blahblah-\DTLite.exe"    
set emu="C:\Users-blahblah-\SSF_TestVer\SSF.exe"    
%daemon% -mount 0, %game%    
start /wait "" %emu%    
%daemon% -unmount 0 
  • So this question is about you wanting it to work with the daemon and not some other solution, correct? I assume specifically you are not looking for an answer with some other suggested solution in place of daemon, correct? That's my interpretation so just wanting to hear you verify or clarify otherwise just in case. – Pimp Juice IT Jan 21 '18 at 19:51
  • I got the .bat to work however, is there a command to close the window AND run the code to launch %emu% simultaneously? It works great but if I could get the window to close on its own instead of after I close the program %emu% it would be PERFECT! Thanks! – HellfireEternal Jan 22 '18 at 5:05
  • Try putting IF NOT DEFINED MINIMIZED SET MINIMIZED=1 && START "" /MIN "%~dpnx0" %* && EXIT at the top of the script and then just run it again to see if that helps. See my answer here with this solution and some description. – Pimp Juice IT Jan 22 '18 at 6:29
  • Otherwise consider running this with Task Scheduler to execute the script with the Run with highest privileges option selected. See my answer here but you could go as far as using the SCHTASKS /Run /TN "\path\JobName" method to execute perhaps. There are some starting points for you to test with at least that I can think of quickly but I provided to sources my answers with more applicable detail. – Pimp Juice IT Jan 22 '18 at 6:31
1

I suppose the %1% is a mistake and should be %1 and you should run the batch file with a parameter like the name of the game. e.g. C:\blah>thebatfile thegame That will be what %1 refers to i.e. the first parameter. You can view any variable with echo %whatevervar% or echo %1 and echo %daemon% And you can remove the @ECHO OFF line so that you can see more of what is going on. And at any time in the batch file you could do pause(when running it it will pause after a line and you can do ctrl-c to exit), or you can try a line that says exit /b to exit the batch file early.

While I think that might answer your question about the %1, it might not help you beyond answering your question. Going beyond your question - Where are you getting this batch file from? It might have various issues with it that are dependent on the specifics of the executables that it is helping you to run.

You might be better off avoiding daemon tools. At one time it was great software, for years, but then they added malware to it http://forum.daemon-tools.cc/showthread.php?t=30115 and https://www.reddit.com/r/pcmasterrace/comments/2yt9gb/be_aware_daemon_tools_lite_installs_malware_adware/ I suggest you use virtual clonedrive instead.

If you want to mount an image then first do it without a batch file. And to start the game, once the image is mounted, then run it without a batch file.

Once you can do it manually then you could try doing it with a batch file.

  • I got this batch file from the forums of the program I am using. It is called Launchbox it is a front end for emulators. It is a GUI where you put multiple game files and choose the programs to launch the games with. It works great but this particular emulator, SSF, cannot read Image files on its own. They must be read from a cd drive (or a virtual drive) instead. And this is where the issue begins. – HellfireEternal Jan 21 '18 at 18:37
  • @HellfireEternal Yes but you don't need a batch file to do these things. You can manually mount an image. And you can manually start the emulator. Anything that a batch file can do, can be done manually. Some old programs for example need a CD in the drive, or as in your case, mounting an ISO so it sees a CD Drive.. That can be done manually. – barlop Jan 21 '18 at 18:42
  • I got this batch file from the forums of the program I am using. It is called Launchbox it is a front end for emulators. It is a GUI where you put multiple game files and choose the programs to launch the games with. It works great but this particular emulator, SSF, cannot read Image files on its own. They must be read from a cd drive (or a virtual drive) instead. And this is where the issue begins. I was assuming the set game=%1% portion was grabbing the file path from Launchbox. The problem with the batch file seems to be in getting the file path of the image file. Any ideas? – HellfireEternal Jan 21 '18 at 18:44
  • I think the game is the ISO. You mount the game. Then you run the emulator. – barlop Jan 21 '18 at 18:45
  • The link is forums.launchbox-app.com/topic/… if that helps – HellfireEternal Jan 21 '18 at 18:45

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.