Windows 10: Running PowerShell script as a batch file

Discus and support Running PowerShell script as a batch file in Windows 10 Network and Sharing to solve the problem; Can I run the Power Shell line: "C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage" from a .Bat file? ***Original title: Removing... Discussion in 'Windows 10 Network and Sharing' started by BaldoUMC, Nov 25, 2018.

  1. BaldoUMC Win User

    Running PowerShell script as a batch file


    Can I run the Power Shell line: "C:\Windows\System32>get-appxpackage *3dbuilder* | remove-appxpackage" from a .Bat file?



    ***Original title: Removing bloatware***

    :)
     
    BaldoUMC, Nov 25, 2018
    #1

  2. How to run batch file with powershell


    Create a shortcut to your batch file (right-click drag+drop the file). Then edit the shortcut's Properties->Shortcut->Advanced.


    Running PowerShell script as a batch file [​IMG]
     
    PolarNettles, Nov 25, 2018
    #2
  3. PowerShell script run - Cmdlets

    Greetings - in the last month my role (support for Microsoft) has begun running database searches using PowerShell ISE - the procedure and software I was given by Microsoft to follow specified PowerShell ISE, not PowerShell. The first week or so the searches
    seemed to run fine and I got good results returned. Then the searches stopped successfully executing. I got various error messages, or just illogical results, and so I tried reinstalling PowerShell a couple of times, with no success. On Friday 8/12 I upgraded
    to Win10 Anniversary Ed. I still can't successfully run a PowerShell ISE search request. So, I'm hoping the Forum can help:

    1. When I Run a request I get this pop-up: "Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this script, use the Unbock-File cmdlet to allow the script to run without
    this warning message. Do you want to run ...". I then get 3 options 1) Do not run, 2) Run Once, 3) Suspend.

    My understanding is that the "Unbock-File cmdlet" is a single-feature command that manipulates objects in Windows PowerShell. Where should I insert the "Unbock-File cmdlet" ? I trust the script because it was provided to me by Microsoft.

    2. I've been selecting option 2) Run Once. The script will then run for a while, and then I get this error message "[Expression Error] The import Cosmos.Document matches no exports. Did you miss a module reference?"

    How do resolve this issue? Reinstalling PowerShell has not seemed to help.

    Any help much appreciated!
     
    Jacqui Schultz, Nov 25, 2018
    #3
  4. eeps24 Win User

    Running PowerShell script as a batch file

    How to run batch file with powershell


    I created a basic batch file that uses "net share" to share a local path. I saved the batch file. When I double click the file I get "access is denied"... note, I am logged on as a admin.

    Anyways... I figure it has to be run using power shell. I do not know much about powershell. Can anyone tell me how I can run this batch file (by double clicking on the icon) using power shell?

    Thank you

    edit.... if I right click the file and click "run as administrator" it runs fine. I want the ability to just double click it and execute.
     
    eeps24, Nov 25, 2018
    #4
Thema:

Running PowerShell script as a batch file

Loading...
  1. Running PowerShell script as a batch file - Similar Threads - Running PowerShell script

  2. Run desktop script in PowerShell

    in Windows 10 Network and Sharing
    Run desktop script in PowerShell: I have a script on my desktop that I need to run in PowerShell; how do I do that? https://answers.microsoft.com/en-us/windows/forum/all/run-desktop-script-in-powershell/666a7726-8cbd-42c7-ac2c-419229432252
  3. Run desktop script in PowerShell

    in Windows 10 Gaming
    Run desktop script in PowerShell: I have a script on my desktop that I need to run in PowerShell; how do I do that? https://answers.microsoft.com/en-us/windows/forum/all/run-desktop-script-in-powershell/666a7726-8cbd-42c7-ac2c-419229432252
  4. Run desktop script in PowerShell

    in Windows 10 Software and Apps
    Run desktop script in PowerShell: I have a script on my desktop that I need to run in PowerShell; how do I do that? https://answers.microsoft.com/en-us/windows/forum/all/run-desktop-script-in-powershell/666a7726-8cbd-42c7-ac2c-419229432252
  5. run a powershell command like a batch file

    in Windows 10 Installation and Upgrade
    run a powershell command like a batch file: I am working as a temp on a Windows 7 to Windows 10 migration team. We've encountered a problem with some software, and a solution has been found that requires us to execute a a single command with PowerShell. However, the command is extremely long and complex, and very...
  6. Syntax for Batch file &/or powershell script to run multiple commands

    in Windows 10 Support
    Syntax for Batch file &/or powershell script to run multiple commands: I wanted a batch file to run the following commands: Start Powershell as administrator cd "C:\Program Files\Macrium\Reflect" regsvr32 RContextMenu.dll regsvr32 RShellEx.dll I can get as far as: Code: echo Start "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" cd...
  7. Automatically Run Batch Script

    in Windows 10 Installation and Upgrade
    Automatically Run Batch Script: Hi everyone When the windows installation is finished, automatically run batch script. How can I do that? Thanks *Wink 122531
  8. Run PowerShell Script As An Administrator

    in Windows 10 Support
    Run PowerShell Script As An Administrator: Hi. So I've been searching online on a way to do this yet I cannot find a way to do it. _______________________________________ I need this in specific: I want to double click a PowerShell script file (which will run as an administrator) from Windows Explorer that has...
  9. How to run batch file with powershell

    in Windows 10 Network and Sharing
    How to run batch file with powershell: I created a basic batch file that uses "net share" to share a local path. I saved the batch file. When I double click the file I get "access is denied"... note, I am logged on as a admin. Anyways... I figure it has to be run using power shell. I do not know much about...
  10. PowerShell Scripting - Run a Script from Shortcut

    in Windows 10 Tutorials
    PowerShell Scripting - Run a Script from Shortcut: How to: PowerShell Scripting - Run a Script from Shortcut [img] Information One of many PowerShell security features is that you can't run a script simply by double clicking it's icon on desktop or in a folder. Doing so will by default open script in Notepad for editing...

Users found this page by searching for:

  1. windows batch run powershell command

    ,
  2. run bat file powershell