tomasz86 Posted November 24, 2011 Author Share Posted November 24, 2011 (edited) NO, the difference is that the L switch WON'T actually copy the file AND it will show the name of the file IF it corresponds to the D switch.You're right (as always ).At the end I've just chosen the simplest method::: updating fp40ext.cabECHO.&ECHO.&ECHO Checking fp40ext.cab...&ECHO.MD TEMP\fp40extcabEXPAND -F:* %SP6%\fp40ext.cab TEMP\fp40extcab >NULIF EXIST HFMER\*.* XCOPY/DUY HFMER\*.* TEMP\fp40extcab\XCOPY/DUY TEMP\i386\*.* TEMP\fp40extcab\XCOPY/DUY TEMP\i386\new\*.* TEMP\fp40extcab\ECHO.&ECHO Repacking fp40ext.cab...CABARC N %SP6%\fp40ext.cab TEMP\fp40extcab\*.* >NULRD/Q/S TEMP\fp40extcabIt doesn't look very pretty but works nevertheless. The only downside is that the cab is repacked even if there are no new files copied. Edited November 24, 2011 by tomasz86 Link to comment Share on other sites More sharing options...
jaclaz Posted November 24, 2011 Share Posted November 24, 2011 It doesn't look very pretty but works nevertheless. The only downside is that the cab is repacked even if there are no new files copied.Hmmm.... What about something like:SETLOCAL ENABLEDELAYEDEXPANSIONSET Counter=0:: updating fp40ext.cabECHO.&ECHO.&ECHO Checking fp40ext.cab...&ECHO.MD TEMP\fp40extcabEXPAND -F:* %SP6%\fp40ext.cab TEMP\fp40extcab >NULIF EXIST HFMER\*.* FOR /F %%A IN ('XCOPY/DUY HFMER\*.* TEMP\fp40extcab\') DO SET Counter=!Counter!+1FOR /F %%A IN ('XCOPY/DUY TEMP\i386\*.* TEMP\fp40extcab\') DO SET Counter=!Counter!+1FOR /F %%A IN ('XCOPY/DUY TEMP\i386\new\*.* TEMP\fp40extcab\') DO SET Counter=!Counter!+1ECHO %Counter% file(s) were added....IF %Counter%.==0. ECHO You just unneededly wasted some processor cycles! &GOTO :WhereverECHO.&ECHO Repacking fp40ext.cab...CABARC N %SP6%\fp40ext.cab TEMP\fp40extcab\*.* >NUL :WhereverRD/Q/S TEMP\fp40extcab jaclaz Link to comment Share on other sites More sharing options...
tomasz86 Posted November 24, 2011 Author Share Posted November 24, 2011 It works but %Counter% is displayed as "+1+1+1+1+1+1+1+(and so on) file(s) were added". Link to comment Share on other sites More sharing options...
jaclaz Posted November 24, 2011 Share Posted November 24, 2011 (edited) It works but %Counter% is displayed as "+1+1+1+1+1+1+1+(and so on) file(s) were added".Change "SET Counter=!Counter!+1" to "SET /A Counter=!Counter!+1"(just checking if you were paying attention )jaclaz Edited November 24, 2011 by jaclaz Link to comment Share on other sites More sharing options...
tomasz86 Posted November 24, 2011 Author Share Posted November 24, 2011 This is the final version::: updating fp40ext.cabSET Counter=0ECHO.&ECHO.&ECHO Checking fp40ext.cab...&ECHO.MD TEMP\fp40extcabEXPAND -F:* %SP6%\fp40ext.cab TEMP\fp40extcab >NULIF EXIST HFMER\*.* FOR /F %%I IN ('XCOPY/DUY HFMER\*.* TEMP\fp40extcab\') DO SET /A Counter=!Counter!+1FOR /F %%I IN ('XCOPY/DUY TEMP\i386\*.* TEMP\fp40extcab\') DO SET /A Counter=!Counter!+1FOR /F %%I IN ('XCOPY/DUY TEMP\i386\new\*.* TEMP\fp40extcab\') DO SET /A Counter=!Counter!+1ECHO %Counter% file(s) were added.IF %Counter%.==0. ECHO.&ECHO There are no new files to add.IF NOT %Counter%.==0. ( ECHO.&ECHO Repacking fp40ext.cab... CABARC N %SP6%\fp40ext.cab TEMP\fp40extcab\*.* >NUL)RD/Q/S TEMP\fp40extcabThe thing is that now file names are not displayed at all. I tried to use this:IF EXIST HFMER\*.* FOR /F %%I IN ('XCOPY/DUY HFMER\*.* TEMP\fp40extcab\') ( DO SET /A Counter=!Counter!+1 ECHO Updating %%I)but while displaying names of the updated files it also displays '0's (when no files are copied) and some other (?) numbers. Link to comment Share on other sites More sharing options...
Yzöwl Posted November 24, 2011 Share Posted November 24, 2011 What you'll could do is run XCOPY /DULY and STDOUT to a file. Then read that file as input looking for n File(s). If one or more files were indicated then create the temp folder, run the xcopy and repack. Link to comment Share on other sites More sharing options...
jaclaz Posted November 24, 2011 Share Posted November 24, 2011 but while displaying names of the updated files it also displays '0's (when no files are copied) and some other (?) numbers.Yeah, life is tough. Read again the lines with |FIND /V ....This:IF %Counter%.==0. ECHO.&ECHO There are no new files to add.IF NOT %Counter%.==0. ( ECHO.&ECHO Repacking fp40ext.cab... CABARC N %SP6%\fp40ext.cab TEMP\fp40extcab\*.* >NUL)makes no sense (what do you think that IF/ELSE exists for? )jaclaz Link to comment Share on other sites More sharing options...
tomasz86 Posted November 25, 2011 Author Share Posted November 25, 2011 What you'll could do is run XCOPY /DULY and STDOUT to a file. Then read that file as input looking for n File(s). If one or more files were indicated then create the temp folder, run the xcopy and repack.Yeah, life is tough. Read again the lines with |FIND /V ....But this would make the script system locale dependent which I would like to avoid Link to comment Share on other sites More sharing options...
Yzöwl Posted November 25, 2011 Share Posted November 25, 2011 Well that would depend upon whether or not you thought for yourself or simply copied my statement exactly as I wrote it.n is never going to be anything other than n in any languageAdditionally, you cannot call something non language dependent which outputs English statements:Checkingfile(s) were added. There are no new files to add. Repacking Link to comment Share on other sites More sharing options...
tomasz86 Posted November 25, 2011 Author Share Posted November 25, 2011 That's why I wrote "system locale" independent, not language independent I'll try to use the temp folder method. Link to comment Share on other sites More sharing options...
jaclaz Posted November 25, 2011 Share Posted November 25, 2011 Don't use XCOPY.Get STRARC:http://www.ltr-data.se/opencode.html/http://www.ltr-data.se/files/strarc.txtit's messages will be English allright AND you will have a "better" file copy utility.jaclaz Link to comment Share on other sites More sharing options...
Yzöwl Posted November 25, 2011 Share Posted November 25, 2011 Are you trying to tell me that different system locales will output an integer differently, or is the wink and sarcasm about language included just to hide the fact that you hadn't looked at my advice and understood it. (you will note that I didn't provide you with code, that would have been in code tags, I gave you information you could use in order to solve the problem you were having, the exact pieces of code you needed were emboldened.)Please also note that user locales would take precedence over system locales so technically you would want the script to be non user locale dependent. Link to comment Share on other sites More sharing options...
tomasz86 Posted November 26, 2011 Author Share Posted November 26, 2011 Where's your sense of humour, Yzöwl? My comment about locales was related only to this part of your message and wasn't intended to be sarcastic at all.Additionally, you cannot call something non language dependent which outputs English statements:Checkingfile(s) were added. There are no new files to add. RepackingI haven't got time yet to try the method you suggested and yes, I'm a beginner when it comes to batch scripting so I don't understand many of your script suggestions until I try to use them in practice. Please don't look for bad intentions everywhere! Link to comment Share on other sites More sharing options...
tomasz86 Posted March 6, 2012 Author Share Posted March 6, 2012 (edited) @jaclazI have a big problem with splitinf. When I use it on this inf file:update.infsome entries are not present in the final file (and in SPLIT_update folder too), ex. the [system32.Files] section comes out empty although it's not empty in the original update.inf.BEAUTY_JOINED_update.inf Edited March 6, 2012 by tomasz86 Link to comment Share on other sites More sharing options...
jaclaz Posted March 6, 2012 Share Posted March 6, 2012 @jaclazI have a big problem with splitinf. When I use it on this inf file:update.infsome entries are not present in the final file (and in SPLIT_update folder too), ex. the [system32.Files] section comes out empty although it's not empty in the original update.inf.BEAUTY_JOINED_update.infThat's probably pretty much "normal".That file has duplicate [system32.Files] entries, second one empty.I seem to remember that entries need to be deduplicated first.jaclaz Link to comment Share on other sites More sharing options...
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