install programs from subdirectories

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
lok12
Posts: 2
Joined: 27 Sep 2012 05:01

install programs from subdirectories

#1 Post by lok12 » 27 Sep 2012 05:09

Hello,
unfortunately i don´t know how to install prgrams from subdirectories. Here is my code:

call "%~dp0\1_cardreader\bc_6_9_13.exe /L0007 /z "--protocol-dir=c:\temp\cyberjack.log --protocol-level=1000 --install=yes --usb=yes --update-newer=yes --noreboot=yes --nfc=yes"
call "%~dp0\2_cardAPI\Setup\setup.exe -s"
call "%~dp0\3_crypt\Win7_32\InstallSilent.bat"
call "%~dp0\4_SAP logon\setup.exe\install_sap.bat"
exit

All the directories you can find under C:\Temp and there are the other directories like cardreader, cardapi\setup and so on. Now i only get error messages that the path cannot be found, may anyone help me out? Every program runs in silent mode, if i execute only one program, it works.

many thanks

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: install programs from subdirectories

#2 Post by abc0502 » 27 Sep 2012 05:21

If the batch is in the same folder with the "Folder" that contain the program there is no need for "%~dp0"
just start with the "FOLDER" name that contain the exe file

for example, if batch on C:\ and the folder is test and has file.exe

Code: Select all

"test\file.exe" -switches here

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: install programs from subdirectories

#3 Post by foxidrive » 27 Sep 2012 06:11

This should work - but check #4 for syntax, unless you have a folder called ...\setup.exe\ :

Code: Select all

@echo off
set folder=c:\temp
call "%folder%\1_cardreader\bc_6_9_13.exe /L0007 /z "--protocol-dir=c:\temp\cyberjack.log --protocol-level=1000 --install=yes --usb=yes --update-newer=yes --noreboot=yes --nfc=yes"
call "%folder%\2_cardAPI\Setup\setup.exe -s"
call "%folder%\3_crypt\Win7_32\InstallSilent.bat"
call "%folder%\4_SAP logon\setup.exe\install_sap.bat"
exit

lok12
Posts: 2
Joined: 27 Sep 2012 05:01

Re: install programs from subdirectories

#4 Post by lok12 » 28 Sep 2012 04:58

Thank you very much abc0502 and foxidrive! Now it works :-) Have a nice weekend!

Post Reply