Windows 10: Need Help Regarding Powershell Command in Batch Script to Mount Wim

Discus and support Need Help Regarding Powershell Command in Batch Script to Mount Wim in Windows 10 Customization to solve the problem; Please Help. I want Powershell to show Grid View as Output of Wim Indexes then when a user select one from menu & press OK it will then mount the... Discussion in 'Windows 10 Customization' started by Disk2019, Sep 22, 2020.

  1. Disk2019 Win User

    Need Help Regarding Powershell Command in Batch Script to Mount Wim


    Please Help.

    I want Powershell to show Grid View as Output of Wim Indexes then when a user select one from menu & press OK it will then mount the selected wim.

    Get-WindowsImage -ImagePath "\install.wim" | Out-GridView -PassThru -Title 'Select Windows Image and press OK'| Mount-WindowsImage -Path "\Mount

    its showing me a Grid View as Output of Wim but when i select any one from menu & press Ok it throw me a error.

    :)
     
    Disk2019, Sep 22, 2020
    #1

  2. Running PowerShell script as a batch file

    Hello Baldo,



    Thank you for writing to Microsoft Community Forums.



    I understand that you want to execute the PowerShell commands as a batch file.



    I tried executing the batch file on my machine but I was unable to execute it as the command was incomplete. However, after making some changes in the command I was able to execute the batch file.



    You can try the following command by saving it in a batch file and check if that helps.



    powershell –Command Get-AppxPackage Microsoft.3dBuilder | Remove-AppxPackage



    Also, as the query is related to running a PowerShell script using a batch file, I suggest you to post the issue on

    TechNet
    forums where we have professionals who have more knowledge about the issue.



    Hope it helps.



    Regards,

    Prakhar Khare

    Microsoft Community – Moderator
     
    Prakhar_Khare, Sep 22, 2020
    #2
  3. phrab Win User
    Syntax for Batch file &/or powershell script to run multiple commands

    Thank you for this. I have a question though. This opens a command prompt as administrator. Is that what all batch files open?

    Need Help Regarding Powershell Command in Batch Script to Mount Wim [​IMG]
     
    phrab, Sep 22, 2020
    #3
  4. Try3 Win User

    Need Help Regarding Powershell Command in Batch Script to Mount Wim

    Batch file, PowerShell guides

    Personally, if I was going to sit down and study something it would be powershell not individual commands in batch files.

    Here's an introduction to batch files - The Command Line in Windows Batch file basics
    And here are some guides by the excellent RobvdWoude
    Batch files - RobvdW
    Batch File Scripting Techniques - RobvdW
    Batch Files Examples - RobvdW
    and some reference guides on individual commands
    <command> /? produces an up-to-date Help file for most commands, this is the only known source for up-to-date, Windows10-specific Help.
    Command-Line Reference - MSDocs {note that the guidance might reflect variants of the command such as older versions or non-WIndows10 versions}
    Windows command index - SS64 {note that the guidance might reflect variants of the command such as older versions or non-WIndows10 versions}
    Just to emphasise the point, the Windows 10 netsh command is a significant step forward from its earlier versions but there is no online guide for this version. All online netsh guides are out-of-date or refer to non-Windows10 variants of the command.

    And powershell guides -
    PowerShell Scripting - The Basics - TenForumsTutorials
    PowerShell Scripting - Run a Script from Shortcut - TenForumsTutorials
    PowerShell commands index - SS64
    PowerShell Tutorials - Windows10Forums [2017] - I am normally wary of this website for reasons that I cannot remember [lots of content copied from this forum possibly?] but their PS tutorial seems OK.
    Mastering PowerShell with Dr. Tobias Weltner [2009] - I've just added this one. Its original website was no longer available so I had to track it down.

    And remember - if it doesn't feel like you're banging your head against the wall, it isn't proper programming.

    All the best,
    Denis
     
Thema:

Need Help Regarding Powershell Command in Batch Script to Mount Wim

Loading...
  1. Need Help Regarding Powershell Command in Batch Script to Mount Wim - Similar Threads - Need Help Regarding

  2. Need help on batch script to shutdown computers from list

    in Windows 10 Gaming
    Need help on batch script to shutdown computers from list: Hi, I would need help to write a bat file to shutdown all the computers listed in the text file. Can someone help me please?This script will extract the list of computers name from the text file and loop to shutdown each computer....
  3. Need help on batch script to shutdown computers from list

    in Windows 10 Customization
    Need help on batch script to shutdown computers from list: Hi, I would need help to write a bat file to shutdown all the computers listed in the text file. Can someone help me please?This script will extract the list of computers name from the text file and loop to shutdown each computer....
  4. 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...
  5. Batch Rename Script Help!

    in Windows 10 Support
    Batch Rename Script Help!: Hello! I am very new to this and need a little help. I am trying to create a batch file that will rename files that are called png_X.png (the X being the number page it is). The code I have is below. It works fine with out the pipe sort command but it sorts the by the ones...
  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. Mounting a windows 10 Wim file using DISM command in command prompt

    in Windows 10 Customization
    Mounting a windows 10 Wim file using DISM command in command prompt: Hii, I am facing error while mounting windows 10 Wim file using DISM. The error i am getting is Error:5 Access is denied The DISM log file can be found at C:\windows\Logs\DISM\dism.log I have attached the screen shot of the command prompt. Kindly provide any...
  8. Running PowerShell script as a batch file

    in Windows 10 Network and Sharing
    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***...
  9. Help needed writing batch script!

    in Windows 10 Support
    Help needed writing batch script!: Firstly thank you for even clicking on this thread as I understand that this probably isn't meant to be here. The scenario is that I'm trying to write a script that incorporates the result of a ping to an IP and then based on the result do different things. Here is an...
  10. Edit registry on a mounted wim

    in Windows 10 Customization
    Edit registry on a mounted wim: Can anybody tell me how to modify the registry on a mounted wim? I keep getting Access denied. This is the command I am using: reg load hkey_local_machine\software c:\test\offline\windows\system32\config\software We have Windows 10 64 bit Enterprise edition. 92826