AlBundy33, on Jun 19 2006, 08:11 PM, said:
I forgot that PUSHD needs enabled command extensions because they are enabled by default at my system.
[...]
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
[...]
* Very good trick indeed.
- Please note that extensions are enabled by default on ALL winXP systems.
So if you didn't change it, no worry.
Now, you're true, we can just keep 'SETLOCAL ENABLEEXTENSIONS' at the top of the script to be sure.
- On the other hand, I don't recommand enabling delayed expension (off by default) if you don't require it.
In some situations this can bring more mess than solve issues. You script doesn't require it.
Also note that even with ENABLEDELAYEDEXPANSION, you can still use '%' as a variable marker: only those marked with '!' have their expansion delayed, though.
* There may be another issue when using WPI from a network share if WPI itself is on the share:
you need to lower the security in order to run unsigned programs (WPI itself) without the "Open file" security Warning.
SET "KEYD=HKCU\Software\Microsoft\Internet Explorer\Download"
SET "KEYP=HKCU\Software\Microsoft\Windows\CurrentVersion\Policies"
REG add "%KEYD%" /v "CheckExeSignatures" /d "no" /f
REG add "%KEYD%" /v "RunInvalidSignatures" /t "REG_DWORD" /d 1 /f
REG add "%KEYP%\Attachments" /v "SaveZoneInformation" /t "REG_DWORD" /d 1 /f
REG add "%KEYP%\Associations" /v "LowRiskFileTypes" /d ".cmd;.exe;.hta;" /f
- From my experience, if you run WPI at RunOnceEx, you need to run the above script from T12: running it just before WPI @RunOnceEx fails.
- It may be a good idea to reverse to higher security for HKCU, HKU/.DEFAULT and the Default User's hive once the programs are installed. For example in cleanup.cmd from RunOnceEx.
- In the "LowRiskFileTypes", put whatever extension(s) you use from the share, outside of WPI: WPI deals with the inside ones.
* Also, you CAN use WPI from a network share with absolute paths:
you just have to map the network drive to that path:
NET USE Z: \\DJE\XPCD\install
and then in WPI, have your commands like:
Z:\myprog.exe -switch
But it may be less convenient than your method. Which I'm gonna investigate further right now.