BAT script handles Windows files

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.