Solved

psexec problem on 64bit target systems

Posted on 2010-08-23
5
1,589 Views
Last Modified: 2012-05-10
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
Comment
Question by:carlettus
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:Dave_LaSalle
ID: 33501554
try -w C:\WINDOWS\SysWOW64
0
 

Author Comment

by:carlettus
ID: 33501791
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
 
LVL 3

Expert Comment

by:Dave_LaSalle
ID: 33501922
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
 
LVL 68

Accepted Solution

by:
Qlemo earned 500 total points
ID: 33508645
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
 

Author Closing Comment

by:carlettus
ID: 33529547
It's working great.
thank you.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now