i want a CMD code that can find specific literals in another cmd file. i needed this for my unattended program installation.
eg. i want to replace the literal "%CDROM%" in a cmd file with "install"
eg. of cmd code:
the program should do the following:
before the program execution:
echo
echo installing program xxx
start /wait %CDROM%\Install\xxx\xxx.xxx
after the program execution:
echo
echo installing program xxx
start /wait install\install\xxx\xxx.xx
thanx a bunch
Page 1 of 1
CMD finding literals in a file
#2
Posted 23 October 2005 - 08:47 PM
You could
[indent]set CDROM=install
before calling the cmd.
[indent]set CDROM=install
before calling the cmd.
#3
Posted 24 October 2005 - 12:34 AM
Try this on my computer I get back this INSTALL\
Quote
echo off && CLS && Mode 75,5 && Color F3 && Title Test CDROM Varible
for %%i in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do if exist %%i\SETUP.exe set CDROM=%%i
set INSTALL=%CDROM%
set Install=INSTALL
echo %INSTALL%\
pause
for %%i in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do if exist %%i\SETUP.exe set CDROM=%%i
set INSTALL=%CDROM%
set Install=INSTALL
echo %INSTALL%\
pause
- ← Using shared library built from lower version Visual Studio
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- Visual C++.NET Compiler →
Share this topic:
Page 1 of 1



Help
Back to top









