Jump to content

CMD finding literals in a file


Recommended Posts

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

Link to comment
Share on other sites

  • 3 weeks later...

Try this on my computer I get back this INSTALL\

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...