0

OS is Win 7 Home 32bit on A Dell Inspiron 3541 laptop.

I am working on making the *.inf file for a CD that will do the following things:

  • install Dosbox.exe emulator
  • make the directory on the hard drive for the DOS game
  • copy the dos game from the CD to the dir that was made made on the hard drive.

What I have gotten done so far is below

@echo off
echo WELCOME TO WOLF3D COPYER.
echo This BAT file will 1st install Dosbox.
echo Then make the directory and copy the game to the HD.
pause
{I forgot to add this line, I am still working on the synctext} start=dosbox.exe
mkdir C:\dgames\dgames\wolf3d
copy

I am stuck on the syntax for the copy cmd that tells the inf file to look in the CD-ROM drive regardless of the drive letter. I remember the cmd been something like $%drive letter%$ or something like that. It has been a while since I used it. And all my notes in txt files are gone when the D: hard drive in the external USB case crashed. Does anyone know what that cmd syncwince is?

2
  • To Lưu Vĩnh Phúc are you one of the admin's of this forum? If not then how and why did you edit my post? Only the admin and my self can edit my post and most admin's don't edit a post unless it had bad words in it.
    – reble
    Jun 13, 2017 at 13:36
  • StackExchange allows most users with sufficient "reputation" to edit posts for clarity and to correct obvious errors (e.g., spelling). Corrections usually have to be approved by a moderator, though with sufficient reputation, some users may not need to be double-checked. Jun 13, 2017 at 14:31

3 Answers 3

0

This will work, but you have to do run as administrator on script, otherwise fsutils will not work even if you are admin.

set cdrom=None
for %%d in (a b c d e f g h i j k l m n o p r s t u v w x y z) do (
    fsutil fsinfo drivetype %%d:|find "CD-ROM">nul&&set cdrom=%%d:
      )
echo %cdrom%

additionaly with setx command you can create permanent system environment variable for later reuse

5
  • oooooo by the way I know what "utils" is but what does the "fs" mean?
    – reble
    Jun 13, 2017 at 13:41
  • I added the lines in the shaided box and nothing happens. Also what is the start cmd syncwince to start Doxbox installing?
    – reble
    Jun 13, 2017 at 13:49
  • @reble - file system utils - command fsutil
    – Drako
    Jun 13, 2017 at 14:03
  • run as administrator cmd navigate to script dir and run it you will see that it will print cdrom drive letter, you can later in script use it, to refer to cdrom use %cdrom%
    – Drako
    Jun 13, 2017 at 14:27
  • What is the cmd for pasting files from the cd to the hard drive in a bat file. I have been searching many hours now online with no luck
    – reble
    Jun 14, 2017 at 1:56
0

The file you've provided is a BAT (batch) file, not an INF (install information used by MSIEXEC) file.

In a batch file, if you want to refer to files on the same drive as the batch file, you can replace the drive letter with %~d0 - that is, if DBINST.EXE is on the same drive as SETUP.BAT, and SETUP.BAT wants to run DBINST.EXE, it could be called as %~d0DBINST.EXE. You can find more information on this type of expression on SS64's Batch Parameter page in the section "Parameter Extensions".

8
  • I thought a bat file was the same as an inf file. The only difference been the *.bat & *.inf was the 3 letter extension. Bat files I have done before. Like this one (c:\dosbox\dosbox.exe -c "cycles auto" -c "mount c c:\games\dgames" -c "c:" -c "cd wolf3d" -c "wolf3d.exe -goobers"). But I never have put together a inf or an ini file. I have mod a ini file from instructions that I have found online.
    – reble
    Jun 13, 2017 at 18:32
  • You need to do a whole lot more research. INF, INI, and BAT files are three different animals, and confusing them is a good way to mess up your system or applications. Jun 13, 2017 at 18:35
  • Which way is best then to go to setup the cd to install Dosbox, make the dir on the hd then copy the dos game to the dir that was made? A bat file or the ini and inf way?
    – reble
    Jun 13, 2017 at 18:39
  • By the way all this dialog is expanding my knowledge in the subject.
    – reble
    Jun 13, 2017 at 18:47
  • The easiest if you're not investing in professional tools is to use a batch file, usually named INSTALL.BAT or SETUP.BAT that invokes the installer for DOSBox and then copies your data into the DOSBox virtual user drive. Jun 13, 2017 at 19:53
0

I finely figured out the correct syntax for the copy line. It now works 100%. [COPY "test file.doc" "C:\dgames\dgames"]. Bellow is the completed bat file.

@echo off echo WELCOME TO WOLF3D COPYER. echo This BAT file will make the directory and copy the game to the HD. pause
mkdir C:\dgames\dgames cd /d "%~dp0" cls echo Your %~d0 drive. cd %~d0 dir cd temp COPY "test file.doc" "C:\dgames\dgames" pause

1
  • After about 14 hours of work I finely got the last syntax bug out of the batch file. The last bug was the xcopy string to copy the game it self and all the games sub directorys from the cd to the hard drive. The final string is [XCOPY "\games*" "C:\dgames\dgames" /e]. I went through many hours of looking at the xcopy cmd syntax switchs at lifewire.com/xcopy-command-2618103. Now that is done I will do the main menu and burn the cd after a few hours of sleep.
    – reble
    Jun 15, 2017 at 10:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .