Questions tagged [start-process]

Start-Process is a PowerShell cmdlet that starts one or more processes on the local computer.

Start-Process is a PowerShell cmdlet that starts one or more processes on the local computer. To specify the program that runs in the process, enter an executable file or script file, or a file that can be opened by using a program on the computer. If you specify a non-executable file, Start-Process starts the program that is associated with the file, much like the Invoke-Item cmdlet.

You can use the parameters of Start-Process to specify options, such as loading a user profile, starting the process in a new window, or using alternate credentials.

Output

  • None or System.Diagnostics.Process
    When you use the PassThru parameter, Start-Process generates a System.Diagnostics.Process. Otherwise, this cmdlet does not return any output.
255 questions
0
votes
0 answers

Run multiple instances of same executable from powershell

I am trying to open two instances of msftpsrvr.exe(CoreFtp) on my local system simultaneously using powershell. I have two .bat files to handle that but once i run it in a function, it overrides the earlier one. I tried with Start-Process with -Wait…
0
votes
1 answer
0
votes
0 answers

JAVA getRuntime().exec used to execute powershell script, Start-Process -wait no longer works

I am trying to execute a powershell script from my java console app, I was able to get this working with the below command: Process p = Runtime.getRuntime().exec("cmd.exe /c start cd "+dir+" & start cmd.exe /k \"Powershell C:\\runscript.ps1…
Kelly b
  • 171
  • 2
  • 14
0
votes
1 answer

Powershell FileSystemWatcher action not working

In the code below action.bat - calls a java process passing the filename as argument and log.txt - logs a line that filename is created with timestamp. I am testing this script by dropping 10 txt files which works perfectly, I repeated this test…
sunnytech
  • 1
  • 2
0
votes
1 answer

Powershell Start-Process does not start the process on remote machine

I am working on a piece where I have to start an application and this application should be keep running in background. I tried Start-Process cmdlet as below: try { Invoke-Command -Session $newsession -Scriptblock { Write-Host "Cd'ing and…
rapport89
  • 109
  • 3
  • 14
0
votes
0 answers

PowerShell: Write to an existing variables.ps1 file with notepad and save the appended variables.ps1 in the same location

I have created a few powershells scripts that work from a variables.ps1. This variables needs to be changed for every install. The script starts by running a simple COPYOUT.PS1. This PS1 copies from an ISO file and places the files on the…
Zach Olinske
  • 517
  • 2
  • 14
0
votes
3 answers

Running a uninstaller as administrator remotely over Powershell

I am working on a small software deployment script which uninstalls and installs a new version of Check_MK remotely by using powershell. Everything is working great - i am able to localize the old service, stop it and determine the installation path…
Marc
  • 103
  • 17
0
votes
0 answers

start-process with elevated credentials and password on file

I want to make a script for my users. It will let us install applications while there are not admins. pw= get-content \\xxx\xxxx\xxx\xxx\pass.txt | convertto-securestring $pp= new-object -typename System.Management.Automation.PSCredential…
Alex Lum
  • 175
  • 2
  • 12
0
votes
2 answers

Start process in PowerShell, dehydrate it's data and detach from it

I am trying to start NodeJS package remotely from TeamCity PowerShell build step. Currently, a part that starts the process looks like this: $npm = "C:\Program Files\nodejs\node.exe" $params = $pathToStart $proc = Start-Process -FilePath $npm…
Maxim V. Pavlov
  • 10,303
  • 17
  • 74
  • 174
0
votes
1 answer

Powershell change IE table title at runtime

The website we're testing uses Windows Authentication. We have a script using Start-Process to launch Internet Explorer with alternate user credentials. Looks something like: $username = 'test\AdminUser1' $selected_password =…
0
votes
1 answer

Powershell Start-Process permission denied

Could anyone tell me, why do I get an Error if I invoke: $log = $env:TEMP + "\File.log" $stdErrLog = $env:TEMP + "\stderr.log" $stdOutLog = $env:TEMP + "\stdout.log" $argument = "Get-Childitem c:\" Start-Process powershell.exe -Credential…
user4105197
0
votes
1 answer

Ensure Start-Process starts and finishes in order

PowerShell script has the following Start-Process "D:\Script\EMAIL_Snapshot_Done.bat" $date, $scr_comp Start-Process "D:\Script\BATCH_gup.bat" How to ensure that first Start-Process starts and finishes BEFORE second Start-Process begins?
Glowie
  • 2,271
  • 21
  • 60
  • 104
0
votes
1 answer

Maintain single instance of start-process

I am using powershell on Windows 8. I am using this line of code... start-process -filepath "C:\Program Files\Internet Explorer\iexplore.exe" -argumentlist "-k http://localhost/" ...to start IE. This works, however, when the event is triggered…
GiantDuck
  • 1,086
  • 3
  • 14
  • 27
0
votes
0 answers

Powershell Start-Process for a remote machine not working

remotePSExecuter.ps1 file: $InputArgs=$args[0] $Username=$args[1] $Password=$args[2] $ComputerName=$args[3] $PSToExecute=$args[4] write-host $Username $Password $ComputerName $PSToExecute $SecurePassWord = ConvertTo-SecureString -AsPlainText…
Shashi Ranjan
  • 1,491
  • 6
  • 27
  • 52
0
votes
1 answer

PowerShell: Another instance of Start-Process is already running

There are 2 PowerShell scripts that run at startup, 1 is in my control and the other is out of my control. Both of our scripts use Start-Process. Strange issue is if both of our Start-Process's happen to execute at the same time, I get the…
Vippy
  • 1,356
  • 3
  • 20
  • 30
1 2 3
16
17