Questions tagged [psexec]

1

votes
2

answer
30

Views

delims varible doesnt match a string

So our DNS somtimes goes a bit wrong and give out the wrong address. So I created this code to make sure my script is working on the right computer. However it always fails It never matches at the IF? extract: SET /P Computer=Type here psexec \\%Computer% hostname >hostname.log for /f 'delims=' %%...
user3131861
1

votes
1

answer
315

Views

Run PSEXEC process in ASP.NET as different user

I'm trying to connect from my ASP web application published on IIS server to some servers using psExec, start application and get the output. When I try to start process without setting credentials I get this error: Access is denied but if I do the same as administrator, I'm only getting empty fiel...
Toxa O'Connor
1

votes
1

answer
570

Views

How to run tool with psexec interactively for all logged-in users?

I know how to use psexec to run a programm interactively for a single session: PsExec.exe -s -i 7 \\computername notepad.exe But I Need to run it for all logged-in users, not just for a specific session. How to do that?
OriginalWombat
1

votes
1

answer
1.3k

Views

PsExec works only with “runas /netonly”, not with -u and -p parameters

What I mean is: With correct credentials, if I run runas /netonly /user:computername\username cmd then enter the password for the local admin account username then type psexec \\computername cmd I now have a working shell and can run commands as the local admin user on the remote machine as if I wer...
Mini
1

votes
1

answer
281

Views

Powershell get folders sizes with sort on remote computer using psexec and oneliner

I need to get folder sizes on remote computer using psexec ( command is limited to 255 characters ). Main things: psexec [ limit to 255 characters ] - oneliner powershell executed from cmd sort by bytes eliminate values lower than something in MB I managed to do this this way (without sort/greater t...
mike
1

votes
1

answer
98

Views

How find /i “String” on PsExec output on cmd

I want to run a remote command using PsExec.exe and analize the output to know if it was successful: PsExec.exe -i -s -d \\60.60.43.3 -u MYDOMAIN\User -p 12345678 calc.exe | find /i 'ID' If %errorlevel% equ 0 echo OK If %errorlevel% equ 1 echo NO Pause I always get 'NO' as output. Eventhough I can...
Davis8988
1

votes
0

answer
39

Views

MSDeploy “exited with code 6” happens randomly

I have an annoying issue with MSDeploy. About the deployment just in a nutshell: We have a quite complicated deploy process with 15 WebSites, 6 Windows Services, SQL scripts, etc... The whole process executed with a batch file. Which calls into MSBuild targets. At some point MSBuild uses PSExec to c...
Major
1

votes
0

answer
523

Views

Using psexec to copy files from local machine to a remote desktop

Inorder to copy files from my local system to a remote desktop I use the following command psexec \\192.168.xx.xx -u username -p password xcopy 'C:\Users\User\Desktop\source' '\\192.168.xx.xx\C$\Users\User\Desktop\target' /S /Y /F /I I am getting a this error 0 File(s) copied `ƒ♦╝# zü┴k xc...
1

votes
0

answer
164

Views

Execute powershell script using psexec

I am trying to execute PowerShell script on 10 computers on same $env:userprofile path using psexec.But it won't work. If i specify path like 'c:\Users\bob\' , it works. Below script is not working. psexec -u domain\bob -p password -h -d cmd /c powershell.exe -Command '(New-Object System.Net.Webclie...
user30276
1

votes
1

answer
86

Views

How to fix psexec not running PowerShell script on VM?

I am using PsExec to run a PowerShell Script on a VM. I execute psexec like this psexec \\ip -c -i -u Admin -p password PowerShell C:\Path to PowerShellscript on computer PowerShell runs and it opens on the VM but immediately closes. It gives me this message in cmd on my computer PowerShell.exe exit...
techguy1029
1

votes
0

answer
47

Views

How to run psexec using subprocess.run()?

Here's the script snippet: import subprocess output = subprocess.run(['psexec.exe', '\\\\', '/u', '\\TestAdmin', '/p', '', 'cmd /c dir'], capture_output=True, text=True, shell=True) print(output.stdout) print(output.stderr) And here's the output I get: E:\python-scripts>python runpsexec.py PsExe...
yasouser
1

votes
2

answer
63

Views

Running multiple commands on EC2 using psexec and AWS CLI

I'm trying to use CMD script to run two commands on Amazon EC2s using 'psexec' command to run specific batch file to download specific file on these machines and the other command triggers .exe file to update SVN project, the problem is the current script runs the first action only and ignoring the...
Ehab Al khashman
1

votes
0

answer
14

Views

Failed to open android emulator on remote machine using PsExec

I have Android Emulator and using command line i can open my emulator using this command: %ANDROID_HOME%\emulator\emulator.exe -avd Pixel_XL_API_27 Now i want to do the same but this time from another machine so i try to use this command: C:\PsExec.exe -u domain\myUser -p myPassword \\192.168.1.2 -a...
falukky
1

votes
2

answer
4.4k

Views

Using Psexec with Windows Server 2003

I'm trying to run a psexec command to a remote Windows Server 2003 machine. I run the following command: psexec \machinename perfmon.msc -u machineadmin -p adminpassword -i -s The -i and -s flags will allow me to run the GUI for perfmon.msc on the remote machine's desktop interactively. I get the fo...
cmmacphe
1

votes
1

answer
1.3k

Views

PSEXEC not redirecting 7zip output

I'm trying to use PSEXEC to uncompress a self extracting file (a console exe created with 7zip) in a remote machine and view the results on my screen. The remote command executes just fine, but I don't see it's output locally. This is the command I'm using: PSEXEC.exe \MACHINE_NAME -u USER_NAME -p P...
rettiseert
1

votes
1

answer
419

Views

Bamboo, NAnt, and PSExec shows no Console UI

I need NAnt to kick off a long running console app on the local machine during a Bamboo build. It does this correctly but without the console UI. Rather than try to show all that, I have worked it down to a trivial example that also does not show the UI. When I type the following: C:\PSExecPath\ps...
Trey Gramann
1

votes
1

answer
2k

Views

PSEXEC - Updating HKEY_CURRENT_USER when both accounts are different

I read this from a posting in the Windows SysInternals forum. The HKCU - hive key current user - will point to that user's hive key who authenticated on the remote machine with the help of psexec. It will not point to the user's hive key who has logged on interactively to the machine's desktop, unle...
Mitch Hall
1

votes
1

answer
1.2k

Views

How to install on remote PC with psexec with my c# code

I'm trying to install some software remotely from our domain server to all the PC's in the office. I know the code to install it silently on the local computer and have tried various things that I've found while searching to install it remotely when pressing a button in my app but I can't get it to...
Mutley
1

votes
1

answer
2.1k

Views

psexec powershell output

I try remote execute powershell script like this: psexec -i \\host -u user -p pass PowerShell C:\tst\tst.ps1 Source code for tst.ps1: $TempLogFilePath = '$(Get-Date -u '%Y-%m-%d')-LogFileEventLog.log' Start-Transcript -Path '$TempLogFilePath' -Append echo (Get-Date –f o) Stop-Transcript Exit 0 Whe...
Shampoo
1

votes
4

answer
16k

Views

Opening cmd using psexec to a specific remote directory

The goal is to delete the temporary internet files on a remote computer. start psexec -u domain\username -p password -s \\xxx.xxx.xxx.xxx cmd cd C:\Documents and Settings\USERACCOUNT\Local Settings\Temporary Internet Files Which is connecting to the remote computer but just opening to c:windows\s...
pmcfarland
1

votes
1

answer
828

Views

Using PsExec in a Windows Service

I have created a Windows Service using C# which performs variance network maintenance tasks for me. One of the tasks is defraging machines remotely and for some of my older boxes I found the only way to do this was using psexec with defrag.exe. The code works fine when I simply run my C# code, how...
mgrenier
1

votes
2

answer
388

Views

psexec stalls when ran with Java

I'm using psexec and sc query state= all to print out all of the services on a remote server. I'm wanting to parse the output of this and have been trying to use a BufferedReader to do this. Runtime rt = Runtime.getRuntime(); String line = null; Process pr = null; pr = rt.exec('test.bat'); BufferedR...
bunduru
1

votes
1

answer
985

Views

batch file creation pse

I'm trying to run a batch file that will connect to the list of ip's on my network, open up cmd then run a list of commands: like ipconfig /all, nbstat -c, arp -a. Then it must save the results into a folder renamed as that 'computername'. I already have a batch file made that can do the commands I...
badbiddy
1

votes
1

answer
2.5k

Views

How to execute Powerpoint on a remote computer using psexec

I have a remote computer I'd like to launch a powerpoint presentation remotely using psexec. I would like the powerpoint presentation to launch on the REMOTE computer. I'm trying to execute the following command and it says 'invalid file name' I have verified the file exists psexec -u domain\user...
Shmewnix
1

votes
1

answer
330

Views

Right runspace for psexec in script call from c#

I am writing a short c# program which execute a powershell script test.ps1. The code is the following : Runspace runspace = RunspaceFactory.CreateRunspace(); runspace.Open(); Pipeline pipeline = runspace.CreatePipeline(); pipeline.Commands.AddScript(scriptText); pipeline.Commands.Add('Out-String');...
user1594047
1

votes
2

answer
111

Views

Remote launching C++ apps

My problem is simple, I have 1 computer conected to many powerfull servers. I want to execute the app locally but run the process (heavy load) in the remote servers. The app+settings vary a lot, and I want that this exactly version of the app+settings folder to be used by the remote instances. My ap...
DarkZeros
1

votes
1

answer
1.5k

Views

Powershell - Copying File to Remote Host and Executing Install exe using WMI

EDITED: Here is my code now. The install file does copy to the remote host. However, the WMI portion does not install the .exe file, and no errors are returned. Perhaps this is a syntax error with WMI? Is there a way to just run the installer silently with PsExec? Thanks again for all the help...
superKing
1

votes
2

answer
18.4k

Views

Psexec is not running an EXE program remotely

Check everywhere for a reason but nothing I found matches my specific problem. I have a program in C:\somefoldername\anothersubdirectory\andanother\ of the remote pc that I try to run using PSEXEC but it does not take. PSEXEC just does not want to run anything for me. Now if I run a ping or taskl...
user3377627
1

votes
1

answer
2.7k

Views

Calling psexec from a python script doesn't show the whole output

I want to use a python script to show up all local administrators in our domain. My Code : for line in open(anfangsrechner,'r'): zeile = line.strip() command ='\\\\' +zeile+ ' -i' ' net' ' localgroup' ' Administratoren' abfrage = subprocess.Popen(['PsExec.exe ',command,],stdin=subprocess.PIPE, stdou...
access199
1

votes
1

answer
232

Views

problems executing psexec in a call to _wsystem

from within my native application I have to start another application (toolB.exe) on another computer on the local network. to do this I use psexec and a call to _wsystem. for now, I am trying to start toolB on the same computer instead of on the remote computer. so in my code I have this: const std...
mtijn
1

votes
1

answer
322

Views

VB.NET - PSEXEC and SecureString Class?

I have a tool I'm working on in vb.net that essentially lets IT users in my org trigger a number of remote GUI processes on PCs. I call PSEXEC from within my application and pass it the user and password of a service account I have set up. I want to be as security conscious as possible and am looki...
Oryx
1

votes
1

answer
3.6k

Views

PSExec Pass argument with spaces for powershell

With PSexec tool, I am invoking a powershell session on remote computer and executing a PS1 script. I need to pass argument to this powershell script file. It works fine if the argument does not contain space. If the argument does contain space, everything after space is trimmed. Below is my command...
404
1

votes
3

answer
6k

Views

No password for psExec works, but empty string to password flag does not

I'm using a program called psExec to remotely connect to a machine and start an interactive program. The machine I'm connecting to, does not have a password. So if I run this: psExec \\Computer_Name -u User -i -d calc.exe It prompts me for a password: Password: I just hit enter(since the com...
Trevor Hickey
1

votes
1

answer
1.5k

Views

“ERROR: Invalid syntax. Default option is not allowed more than '2' time(s).” using SETX

I thought I had this working at one time but recently my command quit working. My research here and abroad is not turning up anything I have not attempted already. Perhaps there is some other variable I am missing that SETX is looking at? My command: setx /s servername PATH '%Path%';'c:\program file...
gritts
1

votes
1

answer
191

Views

Display Batch file output message in local machine

I am using psexec tool to run a batch file in remote machine. Everything is good except that I am unable to see any batch output messages that we usually see in cmd window. I want these msgs on my local machine psexec shell window. Is there anyway to do that? I am using the command as: psexec -u adm...
Aprilian8
1

votes
2

answer
2.4k

Views

how to execute python script on remote machine using psexec?

I am trying to execute a python script on remote machine using psexec. The python script is already on the remote machine i only want to execute it there. I am using the following command: psexec -i -s -d \\123 -u xyz -p xyz C:/sample.py But i get error as : PsExec could not start C:\sample.py on 12...
Learner
1

votes
1

answer
542

Views

psexec exit with process id in jenkins

In Jenkins, while using psexec to run a batch file psexec \\workstation007 -u user -p Pa55w0rd -accepteula -i 2 -h cmd.exe /k 'abc.bat' starts a new prompt in remote machine and loops in spinner rotating in console log psexec \\workstation007 -u user -p Pa55w0rd -accepteula -i 2 -h -d cmd.exe /k 'a...
HunterrJ
1

votes
1

answer
4.1k

Views

Alternatives for PsExec which works in standard user

I am using psexec to execute commands on remote server. Here is my command, PsExec.exe' -u user \\server -h run.bat I am entering the password manually. here I am using standard user account due to security issues. When I run the command I am getting the error, 'Make sure that the default admin$ sha...
IT researcher
1

votes
1

answer
546

Views

How to execute psexec command from python without specifying psexec exe location?

I have a python script from which i am executing a process on remote machine as follows: sample= sp.Popen( ['c:/psexec/PsExec.exe','-i','-s','\\\\' + 'xyz','-u', 'sample','-p', 'xyz','C:/sample.bat'],stdin=sp.PIPE, stdout = sp.PIPE, stderr=sp.PIPE) It executes well but what i want not to provide com...
Learner
1

votes
1

answer
1.7k

Views

Mass change powercfg on remote computers

I'm wondering if there is a way to modify the powercfg script to pull from a list of PC's to change the power settings on many remote computers? This is the script i'm using now: psexec \PC-NAME powercfg -change -hibernate-timeout-ac 0 Thanks!
Christian

View additional questions