Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

psexec problem on 64bit target systems

Posted on 2010-08-23
5
Medium Priority
?
1,617 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 71

Accepted Solution

by:
Qlemo earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses

927 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