Background: The following script uses the Export file list, move files, copy files, report system information, segment execution functions
Mainly for in the Easeware company, in the software bug, the required file extraction.
Code Snippet Description:
Cls
ver | Find "5.1." > NUL && goto WIN_XP
: WIN_XP
# # To determine the user operating system for Windows XP will execute: WIN_XP The following code block, other code does not execute.
dir/b/S > FileList.txt
# # Get all the folder names, list of file names in the current directory, and export them to the FileList.txt file
RD/S/q Drivereasy
# # Delete the Drivereasy folder under the current directory
Msinfo32/report%userprofile%\desktop\info.txt
# # Export the user's computer device information and save the file to the desktop
Full code:
@echo offCLS ver|Find"5.1." > NUL &&GotoWin_xpver|Find"5.1." > NUL &&GotoWinVistaver|Find"6.1." > NUL &&GotoWin7ver|Find"6.2." > NUL &&GotoWin8ver|Find"6.3." > NUL &&Gotowin8.1: Win_xp @echoThe current system is: WinXP CD"%appdata%\easeware\drivereasy"dir/b/s > FileList.txtMoveFileList.txt "%userprofile%\desktop"CD"%appdata%\easeware\drivereasy\drivers"CopyDownloaddrivers.data "%userprofile%\desktop"CDC:\ProgramFiles\commonFiles\microsoft Shared\MSInfomsinfo32. Exe/report "%userprofile%\desktop\info.txt"@echo ---------------------------------------- Goto End : WinVista @echoThe current system is: WinVista CD%userprofile%\appdata\roaming\easeware\Drivereasydir/b/s > FileList.txtMoveFileList.txt%userprofile%\DesktopCD%userprofile%\appdata\roaming\easeware\drivereasy\DriversCopyDownloaddrivers.data%userprofile%\Desktopmsinfo32/report%userprofile%\desktop\info.txt@echo ---------------------------------------- Goto End : Win7 @echoThe current system is: Win7 CD%userprofile%\appdata\roaming\easeware\Drivereasydir/b/s > FileList.txtMoveFileList.txt%userprofile%\DesktopCD%userprofile%\appdata\roaming\easeware\drivereasy\DriversCopyDownloaddrivers.data%userprofile%\Desktopmsinfo32/report%userprofile%\desktop\info.txt@echo ---------------------------------------- Goto End : Win8 @echoThe current system is: Win8 CD%userprofile%\appdata\roaming\easeware\Drivereasydir/b/s > FileList.txtMoveFileList.txt%userprofile%\DesktopCD%userprofile%\appdata\roaming\easeware\drivereasy\DriversCopyDownloaddrivers.data%userprofile%\Desktopmsinfo32/report%userprofile%\desktop\info.txt@echo ---------------------------------------- Goto End : Win8.1@echoThe current system is: Win8.1CD%userprofile%\appdata\roaming\easeware\Drivereasydir/b/s > FileList.txtMoveFileList.txt%userprofile%\DesktopCD%userprofile%\appdata\roaming\easeware\drivereasy\DriversCopyDownloaddrivers.data%userprofile%\Desktopmsinfo32/report%userprofile%\desktop\info.txt@echo ---------------------------------------- Goto End @echoCan notget the current operating system version@echo ---------------------------------------- : End Pause
Code
Bat script handles Windows files