[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1619
  • Last Modified:

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.
0
Carlo
Asked:
Carlo
  • 2
  • 2
1 Solution
 
Dave_LaSalleCommented:
try -w C:\WINDOWS\SysWOW64
0
 
CarloAuthor Commented:
I've tried it with w but this is related to the process directory , not the executable.
The installer still gets copied on system32
thank you
0
 
Dave_LaSalleCommented:
You may need to batch for this but try to put the syswow64 folder into the path statement before the system32 entry.

try set PATH=%systemroot%\SysWOW64;%PATH%
this will be temporary
0
 
QlemoDeveloperCommented:
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
0
 
CarloAuthor Commented:
It's working great.
thank you.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now