Windows 10: Batch Scripts / Programs.

Discus and support Batch Scripts / Programs. in Windows 10 Performance & Maintenance to solve the problem; The members and quests who use this forum know how professional, informative and helpful it is! In order to help members solve their problems/issues... Discussion in 'Windows 10 Performance & Maintenance' started by Paul Black, Apr 30, 2020.

  1. Batch Scripts / Programs.


    The members and quests who use this forum know how professional, informative and helpful it is!

    In order to help members solve their problems/issues we often ask them to run certain programs and perform certain tasks and then upload [ post ] the results to the forum for us to look at. To help make doing this easier and to avoid typing errors I have written the following batch scripts / programs.

    chkdsk [ Check Disk ] - ALL Parameters . . .

    Download => CHKDSK_ALL_Parameters.bat.
    Upload => How to Upload and Post Screenshots and Files at Ten Forums.

    chkdsk is a Windows utility program for detecting and repairing any corruptions of the file system [ FAT16, FAT32, and NTFS drives ]. Sometimes this helps if you run it two or three times to get the full recovery of the file system.

    The batch script has 5 Options . . .

    Option [1] ABORT the batch script and EXIT.

    Option [2] chkdsk [ non-invasive read-only and detect mode ].
    This analyses the OS drive and reports any errors or corruptions, but doesn’t repair them.

    Option [3] chkdsk C: /F [ repair mode ].
    Run this if there any errors or corruptions reported when running the above. This one does repair any errors [ file system errors or corruptions ] on the OS drive but doesn’t scan for any bad sectors. This cannot be run while the HDD is in use [ locked ] and is therefore scheduled [ displays a prompt ] to be run at the next reboot. After it has run, Windows will automatically reboot.

    Option [4] chkdsk C: /R [ repair mode ].
    Run this if there are still any errors or corruptions reported. This one does repair any errors [ file system errors or corruptions ] on the OS drive and does scan for any bad sectors. It then attempts to repair or recover any readable information [ implies /F ]. This cannot be run while the HDD is in use [ locked ] and is therefore scheduled [ displays a prompt ] to be run at the next reboot. After it has run, Windows will automatically reboot.

    Option [5] Extract the chkdsk WININIT run data log.
    This extracts the current status [ output data ] for either chkdsk C: /F or chkdsk C: /R. Either of these MUST be run FIRST in order to have the current run data available.

    The batch script creates a WinInit_Log.txt file on the desktop ready to upload to the forum for us to look at!

    The file created ONLY includes the results from the LATEST run.

    chkdsk [ Check Disk ] - Extract The WININIT Run Data Log . . .

    Download => CHKDSK_Extract_The_WININIT_Run_Data_Log.bat.
    Upload => How to Upload and Post Screenshots and Files at Ten Forums.

    This extracts the current status [ output data ] for either chkdsk C: /F or chkdsk C: /R. Either of these MUST be run FIRST in order to have the current run data available.

    The batch script creates a WinInit_Log.txt file on the desktop ready to upload to the forum for us to look at!

    The file created ONLY includes the results from the LATEST run.

    Disk Cleanup - Extended . . .

    Download => Disk_Cleanup_Extended.bat.

    This is an Advanced Version of the Standard Disk Cleanup Tool which allows hidden options to become available and therefore enabling you to cleanup even more HDD space by deleting temporary and not needed files etc.

    Check the appropriate boxes for the items that you want Cleaned and press [OK].

    DXDIAG [ DirectX Diagnostics ] . . .

    Download => DX_Diag.bat.

    DxDiag is a MS diagnostic tool that is extremely useful for troubleshooting and identifying any problems or issues.

    It gives detailed [ technical ] information about the OS including make, model, OS version, GPU, CPU, BIOS, DirectX, hardware, drivers [ outdated and missing drivers ], audio, display, video and other multimedia applications and features etc.

    The information produced falls into the categories . . .

    System Information
    DxDiag Notes
    DirectX Debug Levels
    Display Devices
    Sound Devices
    Sound Capture Devices
    DirectInput Devices
    USB Devices
    Gameport Devices
    PS/2 Devices
    Disk & DVD/CD-ROM Drives
    System Devices
    DirectShow Filters

    The batch script creates a DX_Diag.txt file on the desktop.

    Event Viewer - Clear ALL Logs . . .

    Download => Event_Viewer_Clear_ALL_Logs.bat.

    Over time, the Event Viewer gets very full and cluttered and makes troubleshooting extremely hard. If your OS has been running smoothly for a while without any problems then you can clear ALL the logs. This makes using the Event Viewer [ if needed ] a lot easier and manageable!

    ipconfig /all . . .

    Download => IP_Config_All.bat.
    Upload => How to Upload and Post Screenshots and Files at Ten Forums.

    The batch script creates a IP_Config_All.txt file on the desktop ready to upload to the forum for us to look at!

    msinfo32 [ MS System Information ] . . .

    Download => MS_Info32.bat.

    msinfo32 is a Windows system information utility tool [ system profiler ] which collects information about your computer hardware configuration, computer components, software and drivers etc. It produces a comprehensive overview of your OS and is very useful for troubleshooting and diagnosing computer issues.

    The batch script gives you 4 Options . . .

    Option [1] ABORT this process and EXIT.
    Option [2] Open the msinfo32 consol Window.
    Option [3] Creates a MSI_TXT.txt file on the desktop.
    Option [4] Creates a MSI_NFO.nfo file on the desktop.

    msinfo32 [ MS System Information ] - Find Problem Devices . . .

    Download => MS_Info32_Find_Problem_Devices.bat.
    Upload => How to Upload and Post Screenshots and Files at Ten Forums.

    msinfo32 is a Windows system information utility tool [ system profiler ] which collects information about your computer hardware configuration, computer components, software and drivers etc. It produces a comprehensive overview of your OS and is very useful for troubleshooting and diagnosing computer issues.

    One of these categories is located in MSINFO32 => System Summary => Components => Problem Devices and contains the description of ANY problem device along with the error code and the reason why it is a problem.

    The batch script extracts this information and creates a Prob_Devices.txt file on the desktop ready to upload to the forum for us to look at. If there are NOT ANY problems you will receive the message . . .

    Network Problems [ Diagnose & Repair ] . . .

    Download => Network_Problems_Diagnose_And_Repair.bat.
    Upload => How to Upload and Post Screenshots and Files at Ten Forums.

    The batch script not only collates the information required to diagnose network problems, but can also run network processes to hopefully correct them. The processes are . . .

    ipconfig /flushdns
    ipconfig /registerdns
    ipconfig /release
    ipconfig /renew
    netsh winsock reset [ requires REBOOT ]
    netsh.exe winhttp reset proxy [ if there is one! ]

    The batch script creates a Net_Probs.txt file on the desktop ready to upload to the forum for us to look at!

    Network Statistics And Diagnostics . . .

    Download => Network_Statistics_And_Diagnostics.bat.

    The batch script produces a detailed analysis of network statistics and diagnostics. It produces comprehensive information on current settings and parameters as well as running some network diagnostics which are useful for troubleshooting. Currently [ more may be added later ], the processes run are . . .

    hostname
    ver [MS Windows version]
    arp -a
    ipconfig /all
    getmac
    nbtstat -s
    net start
    netsh interface ipv4 show subinterfaces
    netsh interface show interface
    netsh interface tcp show global
    netsh lan show interfaces
    netsh lan show profiles
    netsh lan show settings
    netsh lan show tracing
    netsh wlan show autoconfig
    netsh wlan show blockednetworks
    netsh wlan show createalluserprofile
    netsh wlan show drivers
    netsh wlan show filters
    netsh wlan show interfaces
    netsh wlan show networks
    netsh wlan show networks mode=bssid
    netsh wlan show onlyUseGPProfilesforAllowedNetworks
    netsh wlan show profiles
    netsh wlan show settings
    netsh wlan show tracing
    netstat -a -b
    netstat -e
    netstat -r
    netstat -s
    nslookup www. google .com [Google]
    pathping 8.8.8.8 [Google]
    pathping www. google .com [Google]
    ping 8.8.8.8 -n 10 [Google]
    ping www. google .com -n 10 [Google]
    tracert 8.8.8.8 [Google]
    tracert www. google .com [Google]
    route print
    tasklist
    query HKEY_LOCAL_MACHINE
    query HKEY_CURRENT_USER

    The batch script creates a Network_S_D.txt file on the desktop.

    NOTE: The batch script process can take a little while to run, so be patient!

    sfc [ System File Checker ] . . .

    Download => SFC_System_File_Checker.bat.
    Upload => How to Upload and Post Screenshots and Files at Ten Forums.

    SFC is a Windows utility program for detecting and repairing any corruptions in the protected system files of the OS. If any files are missing or corrupted, they are replaced from the cached copy which is located in the compressed folder %WinDir%\System32\dllcache.

    Option [2] Run SFC.
    Once SFC has finished running, the scan results are shown in the cmd prompt window. SFC also creates a CBS.log in the temporary folder C:\Windows\Logs\CBS\. This log contains ALL the information generated from running SFC.

    Option [3] Copy the extracted ERRORS ONLY from the CBS.log.
    The batch script extracts the ERRORS ONLY [ as we are only really interested in the ERRORS ] from the CBS.log and creates a CBS_ERRORS.txt file on the desktop ready to upload to the forum for us to look at!

    Option [4] Copy the CBS.log.
    The batch script copies the FULL CBS.log and creates a CBS_Log.txt file on the desktop ready to upload to the forum for us to look at!

    Option [5] Creates a compressed desktop folder and copies the files from Option [3] & Option [4] to it.
    The batch script creates a compressed SFC_Up desktop folder which automatically includes the CBS_Log.txt & CBS_ERRORS.txt files ready to upload to the forum for us to look at!

    NOTE: If any ERRORS are reported, then run SFC again two or three more times, re-booting in between. For some reason, this can make a difference. I think it has to do with the settings.ini file sometimes showing false positives! If you still get a message saying "Windows Resource Protection found corrupt files but was unable to fix some of them", then either upload the files or the folder for us to look at!

    System Reports . . .

    Download => System_Reports.bat.

    The batch script provides a selection of informative reports that are not only extremely useful for the information they contain but for troubleshooting and identifying any problems or issues. The options available are . . .

    01. Run COMPONENTS . . . Installed components.
    02. Run DXDIAG . . . MS diagnostic tool.
    03. Run IPCONFIG /ALL . . . All ipconfig information.
    04. Run MSINFO32 NFO . . . In depth MS information analysis tool.
    05. Run MSINFO32 TXT . . . In depth MS information analysis tool.
    06. Run NTEVENTLOG . . . Event Viewer statistics.
    07. Run PROCESSES . . . Processes running.
    08. Run PRODUCT . . . System installed software.
    09. Run QFE . . . WU and Hotfixes installed.
    10. Run SERVICES . . . Services running and stopped.
    11. Run STARTUP . . . Programs starting at Startup.
    12. Run SYSDRIVERS . . . Basic - Drivers running and stopped.
    13. Run SYSDRIVERS . . . Signed - Drivers that are signed and unsigned.
    14. Run SYSDRIVERS . . . Verbose - Comprehensive drivers report.
    15. Run SYSTEMINFO . . . System information - BASIC.
    16. Run UNINSTALL . . . Uninstall information for installed software.

    99. Run ALL . . . Runs ALL of the above reports and puts them into a desktop folder named Sys_Reports [ the filenames are far more descriptive than above ].

    wmic [ Windows Management Instrumentation Command ] - Comprehensive Report . . .

    Download => wmic_Comprehensive_Report.bat.

    The batch script generates a comprehensive report of system information and settings and are compiled using the wmic. I have obviously not included all of the elements available, or every parameter available within those elements, but I have included those which I think are most useful and informative.

    The report will automatically open when you < Press ANY key to OPEN the file >.

    The batch script creates a wmic_Report.txt file on the desktop.

    The elements included are in alphabetical order and are as follows . . .

    BASEBOARD
    BIOS
    BOOTCONFIG
    CDROM
    COMPUTERSYSTEM
    CPU
    CSPRODUCT
    DESKTOPMONITOR
    DISKDRIVE
    ENVIRONMENT
    GROUP
    IDECONTROLLER
    LOGICALDISK
    MEMCACHE
    MEMPHYSICAL
    NETLOGIN
    NIC
    NTEVENTLOG
    ONBOARDDEVICE
    OS
    PARTITION
    PORTCONNECTOR
    PRODUCT
    RECOVEROS
    SCSICONTROLLER
    SOUNDDEV
    STARTUP
    SYSACCOUNT
    TIMEZONE
    USERACCOUNT
    VOLUME

    WU [ Windows Update ] - Hotfixes . . .

    Download => WU_Hotfixes.bat.
    Upload => How to Upload and Post Screenshots and Files at Ten Forums.

    I have used Microsoft's wmic [ Windows Management Instrumentation Command ] qfe list utility/tool to generate and output the list of WU's [ Windows Updates ] and Hotfixes [ patches ] installed and the date they were installed.

    The batch script creates a WU_Hotfixes.txt file on the desktop ready to upload to the forum for us to look at!

    WU [ Windows Update ] - Log . . .

    Download => WU_Log.bat.
    Upload => How to Upload and Post Screenshots and Files at Ten Forums.

    By default, the WU client records all the transaction information into the log file located at %SystemRoot%\WindowsUpdate.log. The information generated is useful for troubleshooting and investigating problems/issues.

    The batch script creates a WU_Log.txt file on the desktop ready to upload to the forum for us to look at!

    I hope you find these batch scripts useful!

    :)
     
    Paul Black, Apr 30, 2020
    #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, May 23, 2020
    #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, May 23, 2020
    #3
  4. Kreij Win User

    Batch Scripts / Programs.

    Batch program help

    Welcome to TPU tp89 *Toast :toast:

    I'm not knocking your decision, but why would you want to write what is basically a database type program in a batch scripting language?

    Just curious. *Smile Batch Scripts / Programs. :)
     
    Kreij, May 23, 2020
    #4
Thema:

Batch Scripts / Programs.

Loading...
  1. Batch Scripts / Programs. - Similar Threads - Batch Scripts Programs

  2. Batch scripting

    in Windows 10 Software and Apps
    Batch scripting: 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 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...
  3. Batch scripting

    in Windows 10 Gaming
    Batch scripting: 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 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...
  4. Batch scripting

    in Windows 10 Network and Sharing
    Batch scripting: Hi, here's the code that I used for 3 DISM commands to start automatically after pressing a key:@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...
  5. PageFile.sys batch script

    in Windows 10 Virtualization
    PageFile.sys batch script: Hello, I need help writing a batch script that would configure Windows Virtual Memory based on the amount of RAM installed If you have 4 GB of RAM, set virtual memory to 8 GB (Custom size: set both initial and maximum size to 8192) If you have 8 GB of RAM, set virtual memory...
  6. How to undo a batch script

    in Windows 10 Network and Sharing
    How to undo a batch script: I decided it would be a good idea to download and run a random batch script from the internet to get the ability to move files around freely, rather than sticking to the presets. Microsoft, if you see this, please allow us to move and organize files as we wish and not have to...
  7. 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...
  8. Batch scripting problems

    in Windows 10 Ask Insider
    Batch scripting problems: So i found a bug. In batch scripting, I can only store 3 variables. I don't know the cause for this. Here's the code, if you need it. @ echo off title Elevator OS by Lackmey on YouTube and Reddit set gdata=No data found (this one works) set 1data=No data found (this one...
  9. 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
  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...