kukris Posted January 6, 2011 Share Posted January 6, 2011 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. Link to comment Share on other sites More sharing options...
jinjou Posted January 6, 2011 Share Posted January 6, 2011 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 Link to comment Share on other sites More sharing options...
kukris Posted January 9, 2011 Author Share Posted January 9, 2011 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 Link to comment Share on other sites More sharing options...
jinjou Posted January 13, 2011 Share Posted January 13, 2011 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. Link to comment Share on other sites More sharing options...
kukris Posted January 13, 2011 Author Share Posted January 13, 2011 Thanks for the info. 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