Jump to content

Recommended Posts

Posted

I'm currently working on a batch program to automatically rename download hotfixes to their 8.3 file name. So far, i have the file being renamed, the .cat file extracted and both being placed in the i386\svcpack directory. i also have the files and their nessesary switches being automatically entered into svcpack.inf, then compressed to svcpack.in_.

Heres were the problem comes in:

dosnet.inf needs the line:

[OptionalSourceDirs]
svcpack

When this program is run more than once, it adds that string twice. How can i tell it to search for that string in dosnet.inf, and add it if the string is not found, but if it is found then it should leave the file alone?


Posted

Its a lot better and accurate than something like this in cmd language

findstr /i "^svcpack$" "UWXPCD\I386\dosnet.inf"
if '%errorlevel%' neq '0' (
 echo.>> "UWXPCD\I386\dosnet.inf"
 echo [OptionalSourceDirs]>> "UWXPCD\I386\dosnet.inf"
 echo svcpack>> "UWXPCD\I386\dosnet.inf"
)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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