Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

!VARIABLES! not parsing in command file

Featured Replies

Hi all,

I'm sure I must be missing something totally obvious here, but I can't seem to find the cause of the problem I'm having. The problem is that when running a command script (.cmd file), variable names that are enclosed in exclamation marks (like !HFSLP! or !VERSION!) don't get parsed (i.e. they do not return the value that the variable contains). Hence, statements like:

SET /A HFSLP=!HFSLP! + 1

fail completely, and since these are used a lot in the HFSLIP script, the entire slipstream process fails.

I have tried the April 1 and April 21 versions of HFSLIP, and both give the same result. An example of the output shown:

Expanding WindowsInstaller-KB893803-v2-x86.exe
File not found - *.*
0 File(s) copied
A subdirectory or file TEMP\UPDATE already exists.
0 File(s) copied
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
Integrating WindowsInstaller-KB893803-v2-x86.exe
File not found - TEMP
0 File(s) copied
199 COMPLETE
The system cannot find the file specified.
Processing Windows Update
FINDSTR: Cannot open WORK\INFS\199.INF
Completed WindowsInstaller-KB893803-v2-x86.exe

I also tried an older HFSLIP version (dated Februari 3rd, 2006) and get the same results. This version had previously run without problems on the same system, so something must have been changed to the OS or to my system configuration. For the heck of me, I can't think of anything what that might be. I am running XP Pro SP2, with all hotfixes installed.

Any suggestions?

Thanks!

PS: Just curious: why are exclamation marks used around those script variables anyhow? I always thought that one is supposed to use percentage marks (like %VARIABLE%). When changing the exclamation marks to percents, the offending statements run fine...

Edited by lek


Exclamation marks and percentage signs are supposed to work just the same. I don't have any problems with the former, but I'm running Win2K. Maybe someone else can shed some more light on this.

  • Author

I've located the cause of the problem... and it weren't the exclamation marks after all. Serves me right for trying to do something intelligent on a Friday night. :P

What had happened was that when moving some of the source files around my file system, XP somehow decided to rename the file "WIN51IP.SP2" (uppercase) to "win51ip.sp2" (lowercase). That resulted in an unintended effect in the following line:

IF "%VERSION%"=="XP" (

SET T1=TommyP's HFSLIP XP/WMP10/WUA20 Hotfix Slipstreamer

TITLE %T1%

SET PREP=%~dp0

rem SET SP=SP2

if exist source\*.sp* (for /f "tokens=1,2 delims=." %%i in ('dir /b source\*.sp*') do set SP=%%j) else (set SP=SP0)

CALL :SLIPSTREAM

)

...because the SP variable is set to "sp2", instead of "SP2". Later, in the "BANDAIDXP2K3" routine, the problem occurs:

IF "!SP!"=="SP0" SET SPUPDATE=SP1

IF "!SP!"=="SP1" SET SPUPDATE=SP2

IF "!SP!"=="SP2" SET SPUPDATE=SP3

IF "!SP!"=="SP3" SET SPUPDATE=SP4

IF "!SP!"=="SP4" SET SPUPDATE=SP5

IF "!SP!"=="SP5" SET SPUPDATE=SP6

IF "!SP!"=="SP6" SET SPUPDATE=SP7

Here, the SPUPDATE variable is supposed to get set to "SP3", but remains undefined because SP gets tested for uppercase values, but contains a lowercase one. This leads to further pain and suffering further along the execution path.

Anyhow, thanks for the quick reply; hope this clarifies things. Cheers.

Edited by lek

It would've affected other script portions as well so adding a /I to those IF command lines alone wouldn't be enough. I updated the first script section in lek's post (and its surroundings). Try the latest test release.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.