Discussion forum for all Windows batch related topics.
Moderator: DosItHelp
-
phantompanic
- Posts: 4
- Joined: 21 Nov 2017 17:59
#1
Post
by phantompanic » 21 Nov 2017 18:09
Hi,
I am trying to create a .bat file that will install files from one dvd to a specific fold on the hard drive and they ask to insert the second dvd to finish installing the rest of the files to the same folder. As of now I have just had to use one DVD but now I am going to have to use 2 DVD's as there is too many files to fit on just one. Is there a way to have it prompt to insert the second DVD and finish installing certain files? This is the code I have now for just the one DVD.
Code: Select all
@echo off
echo DIGINAV Nautical Charts Installation:
Pause
cd BSBROOT
copy *.* %SystemDrive%\"SeaClear"\BSBROOT /y
cd..
echo ***************************************
echo ---------------------------------------
echo ***************************************
echo The charts have been successfully installed!
Pause
-
miskox
- Posts: 630
- Joined: 28 Jun 2010 03:46
#2
Post
by miskox » 22 Nov 2017 04:42
Maybe it would be easier if you could use DVD9 (dual layer DVD) or USB stick? If not maybe you could compress the files and instead of copying them you would extract them.
Saso
-
aGerman
- Expert
- Posts: 4678
- Joined: 22 Jan 2010 18:01
- Location: Germany
#3
Post
by aGerman » 22 Nov 2017 11:38
I assume
1) You have the first DVD with the following batch file and subdirectory
BSBROOT in the root folder.
2) You have subdirectory
BSBROOT_2 in the root folder of the second DVD.
Code: Select all
@echo off
set "bat=%temp%\CPY_BSB_%random%.bat"
>"%bat%" (
echo @echo off
echo echo DIGINAV Nautical Charts Installation:
echo pause
echo pushd "%~d0\BSBROOT"
echo if errorlevel 1 goto cleanup
echo 2^>nul md "%SystemDrive%\SeaClear\BSBROOT"
echo copy *.* "%SystemDrive%\SeaClear\BSBROOT\" /y
echo if errorlevel 1 (echo An error occurred!^&goto cleanup^)
echo popd
echo echo(
echo :loop
echo echo !!! Insert the second DVD !!!
echo pause
echo pushd "%~d0\BSBROOT_2"
echo if errorlevel 1 goto loop
echo copy *.* "%SystemDrive%\SeaClear\BSBROOT\" /y
echo if errorlevel 1 (echo An error occurred!^&goto cleanup^)
echo popd
echo echo(
echo echo ***************************************
echo echo ---------------------------------------
echo echo ***************************************
echo echo(
echo echo The charts have been successfully installed!
echo echo(
echo :cleanup
echo pause
echo (goto^) 2^>nul ^&del "%bat%"
)
start "DIGINAV Nautical Charts Installation" cmd /c "%bat%"
Steffen
-
phantompanic
- Posts: 4
- Joined: 21 Nov 2017 17:59
#4
Post
by phantompanic » 25 Nov 2017 17:12
The DVD is a product I sell to customers. When they insert the DVD a menu pops. On that menu is a button to click that says "install charts". When clicked on it executes the .bat file and installs the charts. I would like once the first disk is finished installing the charts to their hard drive it will prompt for them to insert the next dvd. I do sell my product on a flash drive but it's more expensive and some customers prefer the DVD. I really appreciate you guys/gals taking your time out to help me.
-
aGerman
- Expert
- Posts: 4678
- Joined: 22 Jan 2010 18:01
- Location: Germany
#5
Post
by aGerman » 26 Nov 2017 04:49
My attempt should work if you don't have this kind of autorun menu on your second DVD.
Steffen
-
phantompanic
- Posts: 4
- Joined: 21 Nov 2017 17:59
#6
Post
by phantompanic » 26 Nov 2017 15:56
Steffen, I will certainly give it a try and post back. Thank you so much!
-
phantompanic
- Posts: 4
- Joined: 21 Nov 2017 17:59
#7
Post
by phantompanic » 26 Nov 2017 18:52
Ok Steffen. It's working GREAT! I only have one other question I think for now. When I insert that second DVD it seems to auto open up a file explorer window showing the contents of the second DVD. Is there anything I can to to prevent that from happening on any computer for that particular DVD? Maybe add some kind of file to it kinda like the "autorun.exe" starts the DVD but something to prevent it from opening that window? Thanks