RaynotRoy Posted May 7, 2005 Posted May 7, 2005 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]svcpackWhen 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?
Bâshrat the Sneaky Posted May 7, 2005 Posted May 7, 2005 You can do that with nircmd.exe or Fedit.exe.
RaynotRoy Posted May 7, 2005 Author Posted May 7, 2005 Do you know the command used? I searched the help file in nircmd, and didn't find anything
Bâshrat the Sneaky Posted May 7, 2005 Posted May 7, 2005 to add:nircmd.exe inisetval I386\winnt.sif Section_Name Value_Name Valueto delete:nircmd.exe inidelval I386\winnt.sif Section_Name Value_Name
Yzöwl Posted May 7, 2005 Posted May 7, 2005 Its a lot better and accurate than something like this in cmd languagefindstr /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")
RaynotRoy Posted May 7, 2005 Author Posted May 7, 2005 Thanks guys, this helps alot. Maybe when I'm done I can post my code.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now