# More than 3 Start-Process in same ps1 gives error

**URL:** <https://forums.powershell.org/t/more-than-3-start-process-in-same-ps1-gives-error/17663>\
**Category:** PowerShell Help\
**Created:** [September 28, 2021, 12:46pm UTC](https://forums.powershell.org/t/more-than-3-start-process-in-same-ps1-gives-error/17663 "2021-09-28T12:46:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![philipscodes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/philipscodes/32/1754_2.png) [@philipscodes](https://forums.powershell.org/u/philipscodes)\
**Post date:** [September 28, 2021, 12:46pm UTC](https://forums.powershell.org/t/more-than-3-start-process-in-same-ps1-gives-error/17663/1 "2021-09-28T12:46:18Z")

</div>

Greetings,  
My ps1 file has codes to open 3 instances of MS Access from different virtual drive locations. Each of the accdb is named differently as well. 2 of these open successfully but the 3rd instance gives an error. If I were to remark out the first 2 then the 3rd one works:

**Error Message:**

Start-Process : This command cannot be run completely because the system cannot find all the information required. At C:\Users\emeraudesystems\Desktop\ScriptGT\DataBankExtractor.ps1:11 char:24 + ... torStockApp=Start-Process -PassThru "E:\EmeraudeBI\DataBankExtractorS ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

The property ‘ProcessorAffinity’ cannot be found on this object. Verify that the property exists and can be set.  
At C:\Users\emeraudesystems\Desktop\ScriptGT\DataBankExtractor.ps1:12 char:1

- $DataExtractorStockApp.ProcessorAffinity=7
- 

```auto
  + CategoryInfo : InvalidOperation: (:) [], RuntimeException
  + FullyQualifiedErrorId : PropertyNotFound

```

**CODE:**

```auto
Copy-Item "E:\EmeraudeBI\DataBankExtractor.accdb" -Destination "E:\EmeraudeBI\DataBankExtractorGeneral.accdb"
$DataExtractorGeneralApp=Start-Process -PassThru "E:\EmeraudeBI\DataBankExtractorGeneral.accdb"
$DataExtractorGeneralApp.ProcessorAffinity=5

Copy-Item "E:\EmeraudeBI\DataBankExtractor.accdb" -Destination "E:\EmeraudeBI\DataBankExtractorBusinessStatistics.accdb"
$DataExtractorBusinessStatisticsApp=Start-Process -PassThru "E:\EmeraudeBI\DataBankExtractorBusinessStatistics.accdb"
$DataExtractorBusinessStatisticsApp.ProcessorAffinity=6

Copy-Item "E:\EmeraudeBI\DataBankExtractor.accdb" -Destination "E:\EmeraudeBI\DataBankExtractorStock.accdb"
$DataExtractorStockApp=Start-Process -PassThru "E:\EmeraudeBI\DataBankExtractorStock.accdb"
$DataExtractorStockApp.ProcessorAffinity=7

```

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [September 28, 2021, 12:54pm UTC](https://forums.powershell.org/t/more-than-3-start-process-in-same-ps1-gives-error/17663/2 "2021-09-28T12:54:20Z")

</div>

Biju Philip,  
Welcome to the forum. 👋🏽

Does it work when you use the correct / verbose way of starting the process?

```auto
Start-Process -FilePath '<path to the Access executable>' -ArgumentList "E:\EmeraudeBI\DataBankExtractorStock.accdb" -PassThru

```

---

<div class="post-metadata">

**Author:** ![philipscodes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/philipscodes/32/1754_2.png) [@philipscodes](https://forums.powershell.org/u/philipscodes)\
**Post date:** [September 28, 2021, 1:12pm UTC](https://forums.powershell.org/t/more-than-3-start-process-in-same-ps1-gives-error/17663/3 "2021-09-28T13:12:14Z")

</div>

Hello Olaf,

Perfect. Thank you for the great pointer.  
Yes, you are correct.  
Using the verbose way cleared a lot of my thinking too.

**New Code:**

```auto
# Specify the Fullpath and filename of the msaccess executable
$sAccess = "C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE"

Copy-Item "E:\EmeraudeBI\DataBankExtractor.accdb" -Destination "E:\EmeraudeBI\DataBankExtractorGeneral.accdb"
Set-Variable -Name "DataBankExtractorGeneral" -Value "E:\EmeraudeBI\DataBankExtractorGeneral.accdb"
$DataExtractorGeneralApp=(Start-Process -Filepath $sAccess -ArgumentList $DataBankExtractorGeneral -PassThru)
$DataExtractorGeneralApp.ProcessorAffinity=5

Copy-Item "E:\EmeraudeBI\DataBankExtractor.accdb" -Destination "E:\EmeraudeBI\DataBankExtractorBusinessStatistics.accdb"
Set-Variable -Name "DataBankExtractorBusinessStatistics" -Value "E:\EmeraudeBI\DataBankExtractorBusinessStatistics.accdb"
$DataExtractorBusinessStatisticsApp=(Start-Process -Filepath $sAccess -ArgumentList $DataBankExtractorBusinessStatistics -PassThru)
$DataExtractorBusinessStatisticsApp.ProcessorAffinity=6

Copy-Item "E:\EmeraudeBI\DataBankExtractor.accdb" -Destination "E:\EmeraudeBI\DataBankExtractorStock.accdb"
Set-Variable -Name "DataBankExtractorStock" -Value "E:\EmeraudeBI\DataBankExtractorStock.accdb"
$DataExtractorStockApp=(Start-Process -Filepath $sAccess -ArgumentList $DataBankExtractorStock -PassThru)
$DataExtractorStockApp.ProcessorAffinity=7

```

Best Regards,  
Philip

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:21pm UTC](https://forums.powershell.org/t/more-than-3-start-process-in-same-ps1-gives-error/17663/4 "2024-05-16T20:21:17Z")

</div>

Closed on May 16, 2024, 8:21pm UTC


