Solved

psexec problem on 64bit target systems

Posted on 2010-08-23
5
1,602 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 69

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
For loop to add numbers 3 85
VB Script/Bat: check if a file has been modified based on prefix 10 77
powershell script 9 67
Batch: reboot servers one by one. 4 25
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
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 count occurrences of each item in an array.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

821 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