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 the audio troubleshooter from a batch script

    in Windows 10 Drivers and Hardware
    Run the audio troubleshooter from a batch script: I have an automated home theatre setup - a batch script that enables my TV as a display, and changes the TV to be my primary display (so games and apps open on my TV instead of my monitor). The same script also changes my default audio device to be the TV. The problem is...
  3. Batch Numbering Files through Powershell

    in Windows 10 Network and Sharing
    Batch Numbering Files through Powershell: Hello, I'm trying to come up with a solution through Powershell that batch numbers files at the beginning of a file name without interrupting the rest of the file name. For example: Current File Names: John Smith.pdf Abel Anderson.pdf Mary Trinity.pdf ..... Rocky...
  4. Powershell script running every 60 seconds

    in Windows 10 Network and Sharing
    Powershell script running every 60 seconds: I have re-purposed an old Toshiba Satellite L650 laptop to stream media in my theatre room. I installed an SSD and reinstalled Windows 10. I have noticed the fan speed would increase and decrease regularly even when I was not touching it. I checked Task Manager and CPU...
  5. 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
  6. 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...
  7. Running an uneditable Batch file

    in AntiVirus, Firewalls and System Security
    Running an uneditable Batch file: Hi people, Got a task to run a certain CMD command on a number of PCs as administrator. So I thought i would create a batch file doing this. This is not the issue. The issue is that I am unable to lock down successfully so people cannot just edit the file to see the admin...
  8. 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...
  9. 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...
  10. Batch script question

    in Windows 10 Support
    Batch script question: Hello, I want make a batch script to delete a spefic folder on the C disk, but how can I get only that spefic folder? I got this: Code: FOR /D %%p IN ("C:\USERS\%USERNAME%\Downloads\*.*") DO rmdir "%%p" /s /q cd C:\USERS\%USERNAME%\Downloads\ del *.* /q /s timeout /t 5...

Users found this page by searching for:

  1. run bat file powershell