Ok, I am having trouble registering OCX files on remote machines using psexec, but think I have figured out where my problem lies.
Basically I have a script that runs the following command
PSEXEC \WORKSTATION1 REGSVR32 /S "\WORKSTATION1\C$\WINDOWS\SYSTEM32\CONTROL.OCX"
This successfully regsiters CONTROL.OCX and my application works... for administrators.
It does not work if a non administrator is logged on.
After hours of research and help on StackOverflow I have determined the reason is within the registry of the remote machine (WORKSTATION1) the location of the OCX file is stored in a string with the value of:
\WORKSTATION1\C$\WINDOWS\SYSTEM32\CONTROL.OCX
instead of:
C:\WINDOWS\SYSTEM32\CONTROL.OCX
Since normal users do not have access to the administrative share C$ they are unable to run the application that relies on the OCX.
Is there anyway to run REGSVR on the remote machine using PSEXEC and have the script treat C:\WINDOWS\SYSTEM32 as the directory on the remote machine instead of the machine I am running PSEXEC from? That way the OCX would register with the proper path name.
Thanks
psexec
passes its arguments directly to the remote program.
Passing C:\WINDOWS\SYSTEM32\CONTROL.OCX
should work fine.