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

Synchronizing pc-clock occasionally by Powershell and W32tm if time difference -gt 10 sec?

once and a while my prg running at a quite high cpu-time consumption. After that the pc-clock could differ up to 10 sec despite I sync. the pc-clock with the internet-time twice a day. Now I want to sync. the pc-clock if the time differs more than…
gooly
  • 1,241
  • 7
  • 20
  • 38
0
votes
1 answer

Powershell: Command Passed To Start-Process Fails

First, i assign this string variable: PS> $newpath="C:\Program Files (x86)\Intel\iCLS Client" This works: PS> [Environment]::SetEnvironmentVariable('Path', $newpath, 'Machine') This doesn't: PS> Start-Process Powershell -ArgumentList "-NoExit…
johny why
  • 2,047
  • 7
  • 27
  • 52
0
votes
1 answer

Multithread in Powershell

My script does the following: Run a process for packet capture (using windump) for 1 hour, data are saved textFile1 Dump data into database after 1 hour Delete text file Run another windump and save data to textfile2 (Then Repeat process. while…
lulala
  • 637
  • 4
  • 12
  • 21
0
votes
1 answer

PowerShell Start-Process loses precision on number passed as a string to a function

I have some code that edits the registry, so it needs to run as admin. To do this, I start up a new PowerShell process from my running PowerShell script, and pass in part of the registry key path, which happens to be a version number, e.g. "12.0".…
deadlydog
  • 22,611
  • 14
  • 112
  • 118
0
votes
2 answers

Start-Process powershell with spaces

I have been at this for a long while now, getting to the point where I'm very frustrated. I'm hoping someone can point me in the right direction. I need to run mysqldump, for 6 specific databases. I need each spawn to run after the last has…
Mike
  • 1,532
  • 3
  • 21
  • 45
0
votes
2 answers

how to execute commands on remote machine using pysphere

Have VMware VM on which i wanted to execute some commands for example shutdown /r or dir /o:d etc... from remote machine. Using module pysphere module for communicating with VM. i tried start_process but it is just creating process for cmd.exe my…
rocky
  • 139
  • 3
  • 16
0
votes
2 answers

VB.net 2010 Window Service Run the actual application not just the process

Here is what I am trying to do is create a service that checks if Microsoft Lync is running. If it's running then do nothing but write to eventlog. If it's not running run the exe and then log in to Lync. The problem I am getting is when it comes…
Jose Ortiz
  • 705
  • 1
  • 9
  • 19
0
votes
2 answers

Using Start-Process for starting a process having its full command line

How can I use PowerShell's Start-Process cmdlet to start a process using its full command line (with executable path and arguments). For instance let I have the following line "/myprog.exe" -arg1 "val1" -arg2 "val2" stored on some string…
Mihran Hovsepyan
  • 10,810
  • 14
  • 61
  • 111
0
votes
2 answers

Using Start-process to kick off a LogParser process, error encountered

I'm using the following code to try to use Log Parser to fire off and dump the contents of a .csv file I have into a SQL database. I'm having to try to use a custom function to strip out non-alphanumeric characters so that the columns can be created…
Sean Long
  • 2,163
  • 9
  • 30
  • 49
0
votes
1 answer

PowerShell Start-Process

Can ssomebody help ti run new process in the same window?? $credential = Get-Credential Start-Process powershell.exe -Credential $credential -NoNewWindow -ArgumentList ".\ListScript.ps1" -Wait Write-Host "Press any key to continue ..." $x =…
user1235794
  • 11
  • 1
  • 4
0
votes
1 answer

Run logon PowerShell Start-Process not as administrator

I'm running PowerShell scripts at logon by: Run: gpedit.msc -> Local Group Policy Editor -> User Configuration -> Windows Settings -> Scripts (Logon/Logoff) -> Logon -> PowerShell Scripts -> Add -> Browse In the script, I'm…
-1
votes
1 answer

powershell - Start-Process -wait + always on top (topmost)

i have the following code: Start-Process -FilePath myprogram.exe -Wait # ... some other code to be executed AFTER the previous process has ended What i need I need to start the process with -wait as you can see, but i also need that that the window…
aetonsi
  • 208
  • 2
  • 9
-1
votes
1 answer

CMD Command doesn't execute

I'm trying to run this command in cmd from c# but for some reason it doesn't work. But when I change my Argument to "/C ipconfig" it work perfectly. I don't understand why. What am I doing wrong? Here is my code: Process process = new Process(); …
Red hood
  • 29
  • 1
  • 1
  • 7
-1
votes
2 answers

Command prompt window opens and closes immediately while running powershell script

I'm trying to run a powershell script as follows: Start-Process -FilePath "C:\svn\Services\trunk\Services.In4m.Agent.Host\bin\agent.exe" -Argument --help Any reason why this could be happening. Also, how to write a script so that the command prompt…
-1
votes
2 answers

Powershell LogonScript How to keep just started process open

I made a quick powershell script with some tasks for updating outlook signature with infos from AD and some unmounting and mounting network shares. Also, the script starts an application on the local computer. The Application starts just fine but,…
tboston
  • 11
  • 4
1 2 3
16
17