Question : psexec problem on 64bit target systems

Dear All,
Lately I've been using PsExec. I use it to copy some NSIS exe installers to remote machines and execute them. The default remote path of these installers seems to be %windir%\system32. Is there a parameter available to change this to something else?

I ask because on 64bit Windows systems you can't execute NSIS installers from the system32 directory, it will throw an error.

Any advice would be greatly appreciated! Thanks a bunch.

Answer : psexec problem on 64bit target systems

If you use the -c option, the file will always be copied into the real system32 folder, as the PsExec service runs in native mode (i.e. 64bit). You need to run a script, checking if running on x64, and then changing the working dir before copying and running anything else:

@echo off
if exist %WinDir%\Sysnative cd /d %WinDir%\SysWow64
copy \\server\share\NSIS.exe .
NSIS.exe

Start this script without copying:

psexec \\remotePC cmd -c \\server\share\instNSIS.cmd
Random Solutions  
 
programming4us programming4us