January 6, 201115 yr Hi everyone,I did a new installation, but Windows update installer package KB898461 (which is present in the HF folder) and several other updates were missing. So I checked the HFSLIP script and found this on line 482:IF EXIST HF\*898461*.exe ( FOR /F %%I IN ('DIR/B/OD HF\*898461*.exe') DO SET PKGINST=%%I ECHO !PKGINST!&MD TEMP&START/WAIT HF\!PKGINST! /Q /X:TEMP...)I tested this section with this test:@ECHO ONIF EXIST HF\*898461*.exe (FOR /F %%I IN ('DIR/B/OD HF\*898461*.exe') DO SET PKGINST=%%IECHO PKGINST=%PKGINST%)PAUSEWhen I run it, I get this output:C:\hfslipWxp>SET PKGINST=WindowsXP-KB898461-x86-DEU.exePKGINST=The variable PKGINST is set, but in the next line, the contents of the variable is gone.Has anyone a solution for this?I'm using Windows XP Pro SP3 German and checked my source with Mimo's File-Checker.
January 6, 201115 yr I haven't tried your test myself, but just off the top shouldn't this:ECHO PKGINST=%PKGINST%be this?:ECHO PKGINST=!PKGINST!Also, you'll need to add this at the beginning of your test:SETLOCAL EnableDelayedExpansionSo, like this overall:@ECHO ONSETLOCAL EnableDelayedExpansionIF EXIST HF\*898461*.exe ( FOR /F %%I IN ('DIR/B/OD HF\*898461*.exe') DO SET PKGINST=%%I ECHO PKGINST=!PKGINST!)PAUSE
January 9, 201115 yr Author Thanks jinjou,that worked. I always thought that referencing the contents of a DOS variable was done this way:ECHO PKGINST=%PKGINST%What is the difference with exclamation marks or when do I have to use that?GreetsKukris
January 13, 201115 yr I always thought that referencing the contents of a DOS variable was done this way:ECHO PKGINST=%PKGINST%You're correct, this is the right way to do it, except when you set the value of a variable in a block (typically, an IF or a FOR statement).What is the difference with exclamation marks or when do I have to use that?You can find an explanation for all this in the online help text of the commands.Try these commands at a prompt:SET /?HELPHELP SETHELP SETLOCALAlso, try these to find additional important information:HELP CALLHELP FORHELP IFHowever, this matter doesn't apply to your original issue, and is not related to this forum. If you have any further questions along this line, you should post to here.
Create an account or sign in to comment