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"
)

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...