Windows 10: Batch scripting

Discus and support Batch scripting in Windows 10 Gaming to solve the problem; Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:Code and result:Code:@echo off echo You are going to... Discussion in 'Windows 10 Gaming' started by Cedric D. Román_OR_SYSTEM, Jan 19, 2022.

  1. Batch scripting


    Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:Code and result:CodeBatch scripting :mad:echo off echo You are going to use DISM. echo 1. To check the image. echo 2. Scan your PC's health echo 3. Restore your PC'S health. echo To continue, press any key. echo Before starting 3 DISM commands, make sure that you're starting this batch file with admin permissions. Also, make sure that your antivirus is not interfering this process. During this process, sit down and relax. pause>nulecho Press any key to go to the next. echo Do you want to start 3 DISM commands? P

    :)
     
    Cedric D. Román_OR_SYSTEM, Jan 19, 2022
    #1
  2. yegorsw Win User

    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 every time I turn off my TV, it disappears from the list of audio output devices in Windows 10, and even when I turn it back on, it does not appear in the list. However, if I RIGHT CLICK on the audio icon and select "troubleshoot sound problems"
    and immediately cancel/close the troubleshooter, the TV is automagically added to my list of output devices.

    My question is - is there any way to have this troubleshooter be launched from a batch script and instantly closed? Alternatively, is there a way to force a refresh of the audio devices through a batch script?
     
    yegorsw, Jan 19, 2022
    #2
  3. Julivgar Win User
    Netfix Batch Script- Fix internet connection

    Somebody please try my batch script Netfix and leave feedback so I can improve it. thank you!

    My goal is to make a troubleshooter to help the built in "Windows Network Diagnostics" fix internet connection problems. How can you help?

    1. Download/copy the code on notepad then save as "Netfix.bat" or "Netfix.cmd"

    2. Test the Batch script

    3. Provide feedback and/or suggestions

    Thank you!
     
    Julivgar, Jan 19, 2022
    #3
  4. Batch scripting

    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, Jan 19, 2022
    #4
Thema:

Batch scripting

Loading...
  1. Batch scripting - Similar Threads - Batch scripting

  2. How do i execute batch script via key combinations?

    in Windows 10 Software and Apps
    How do i execute batch script via key combinations?: I made a batch script that just shuts down my pcWorks well with win 10 but for win 11 the key combinations doesnt seem to workI check the properties i tried resetting with the same combinations, it shuts down the computer, turned pc on and tried the key combinations again, it...
  3. How do i execute batch script via key combinations?

    in Windows 10 Gaming
    How do i execute batch script via key combinations?: I made a batch script that just shuts down my pcWorks well with win 10 but for win 11 the key combinations doesnt seem to workI check the properties i tried resetting with the same combinations, it shuts down the computer, turned pc on and tried the key combinations again, it...
  4. Logon batch or Startup script in 365

    in Windows 10 Gaming
    Logon batch or Startup script in 365: Hello, Microsoft Community,I am experiencing an issue with deploying a batch file to the Startup folder on multiple devices using Intune, and I'm seeking some guidance on how to resolve it.Background: I manage an environment with 365 devices, all integrated into Microsoft 365...
  5. Logon batch or Startup script in 365

    in Windows 10 Software and Apps
    Logon batch or Startup script in 365: Hello, Microsoft Community,I am experiencing an issue with deploying a batch file to the Startup folder on multiple devices using Intune, and I'm seeking some guidance on how to resolve it.Background: I manage an environment with 365 devices, all integrated into Microsoft 365...
  6. Screen saver photo slideshow using Power shell or Batch script in Windows 10 or 11

    in Windows 10 Gaming
    Screen saver photo slideshow using Power shell or Batch script in Windows 10 or 11: Hi Guys, Need your assistance on how to write a script to show slide show photos like a screensaver after few minutes. Here is my current script but nothing works, hope you can help me.# Open PowerShell as Administrator# Set the screensaver to Photo...
  7. Screen saver photo slideshow using Power shell or Batch script in Windows 10 or 11

    in Windows 10 Software and Apps
    Screen saver photo slideshow using Power shell or Batch script in Windows 10 or 11: Hi Guys, Need your assistance on how to write a script to show slide show photos like a screensaver after few minutes. Here is my current script but nothing works, hope you can help me.# Open PowerShell as Administrator# Set the screensaver to Photo...
  8. Why do I get "access denied" when I try to run commands from file through a batch script?

    in Windows 10 BSOD Crashes and Debugging
    Why do I get "access denied" when I try to run commands from file through a batch script?: I am trying to write a script that should run some commands from a file specifically commands for pg_dump and pg_restore, or backup and restore of Postgres database, but I am receiving an "access denied" output.The script looks like this:@echo offrem enters postgres directory...
  9. Why do I get "access denied" when I try to run commands from file through a batch script?

    in Windows 10 Gaming
    Why do I get "access denied" when I try to run commands from file through a batch script?: I am trying to write a script that should run some commands from a file specifically commands for pg_dump and pg_restore, or backup and restore of Postgres database, but I am receiving an "access denied" output.The script looks like this:@echo offrem enters postgres directory...
  10. Why do I get "access denied" when I try to run commands from file through a batch script?

    in Windows 10 Software and Apps
    Why do I get "access denied" when I try to run commands from file through a batch script?: I am trying to write a script that should run some commands from a file specifically commands for pg_dump and pg_restore, or backup and restore of Postgres database, but I am receiving an "access denied" output.The script looks like this:@echo offrem enters postgres directory...