Need help running multiple scripts with parameters at the same time

TBingeman 81 Reputation points
2021-07-13T00:37:48.597+00:00

So I have 17 scripts that I need to run to clear some vulnerabilities within our network. Each of these scripts can be run on a single server, or use a csv or txt file with a list of servers in it. I am trying to write a script that will run the 17 scripts and pass the -ServerFileList parameter to each script. In the end, each script will have a specific txt file for that script to use so there will be 17 different lists of servers. When I run the below code, a PowerShell window will open but then close right away without running the script. These scripts will be run on Wednesday 7-14-21 at 3 PM PST so I need to get this figured out before then or I will have to hard code the -ServerFileList parameter into each script. Any help you all can provide will be greatly appreciated.

Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-3PCookies. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-AdobeJS. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-AnonEnum. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-Autofill. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-Autoplay. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-Autorun. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-ConfOfferRA. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-ElevReq. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-EnumAdminAccts. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-IEInvalidSig. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-IEOutdatedActivex. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-InstallElevated. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-NetworkBridge. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-OutdatedPlugins. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-SolicitedRA. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-WinRMClientBasicAuth. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-WinRMServiceBasicAuth. -ServerFileList "c:\scripts\disable item\Servers Test.txt"'
Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2021-07-13T02:47:22.373+00:00

    Hi,

    It seems the "ps1" extension is missing. Please check to see if this works.

    Start-Process PowerShell.exe -ArgumentList '-File "c:\scripts\disable item\Disable-3PCookies.ps1" -ServerFileList "c:\scripts\disable item\Servers Test.txt"'  
    

    Best Regards,
    Ian Xue

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.