So I have a cmd script that enables lpr port monitor as follows:
+----------PASTE---------------+
@echo off
if EXIST "C:\Windows\SysWOW64" (
"C:\Windows\SysWOW64\Dism.exe" /online /enable-feature /featurename:Printing-Foundation-LPRPortMonitor
exit %errorlevel%
) ELSE (
"C:\Windows\System32\Dism.exe" /online /enable-feature /featurename:Printing-Foundation-LPRPortMonitor
exit %errorlevel%
)
+--------END PASTE-----------------+
When advertising via a task sequence on a 32 bit win7 machine, it works. Lpr is in fact enabled.
When executed on a 64bit win7 machine it ends with exit code 0 in execmgr.log, but it does not in fact enable lpr.
Now if I execute the following from the command line on the 64 bit system, I get an error 11 basically saying I'm running a 32 bit program on a 64 bit os:
+----------PASTE---------------+
C:\Windows>"C:\Windows\SysWOW64\Dism.exe" /online /enable-feature /featurename:Printing-Foundation-LPRPortMonitor
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Error: 11
You cannot service a running 64-bit operating system with a 32-bit version of DISM.
Please use the version of DISM that corresponds to your computer's architecture.
+--------END PASTE-----------------+
If I run the dism from system32 on the 64bit system from the command line it works. So I'm sure you're thinking "so just change your script to run the dism from system32." Well, so was I. But if I change the script to only run dism from system32, I then see exit code 11 in the execmgr.log and again lpr is not enabled.
What am I missing???
-Steve