MSFN Forum: CMD finding literals in a file - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CMD finding literals in a file Rate Topic: -----

#1 User is offline   lesterhung 

  • Newbie
  • Group: Members
  • Posts: 24
  • Joined: 02-June 05

Posted 08 October 2005 - 05:18 PM

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


#2 User is offline   hail_bird 

  • Group: Members
  • Posts: 2
  • Joined: 23-October 05

Posted 23 October 2005 - 08:47 PM

You could
[indent]set CDROM=install
before calling the cmd.

#3 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

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


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy