Window脚本学习笔记之BAT简介

本篇文章不是直接讲技术,而是对我自己学习这些年来的一番感触和简单的介绍,其间也穿插着一些基本的知识,若是学习技术者可跳过,亦不妨碍学习其他。

BAT简介

BAT是Windows的批处理脚本,即以后缀“bat”为window批处理文件,虽然对于真正的编程语言来说,肯定是不足的,对于电脑技术爱好者而言却是一个简单方便却又强大的工具,用好了的话也能有很大的帮助。

其学习难度也不大,而且在一些如批量文件重命名,批量文件移动,文本文件处理等方面,简单而高效。

BAT文件可以直接用文本编辑器编辑好后,直接更改后缀名,即可点击运行。(如下图)

图片中显示的是我做的一个简单的管理系统,其思路很简单,却也有一些重要的知识点在其中,这篇文章就围绕我这一个简单的系统来讲解一些基本的知识点和注意事项,仅做为学习参考。

以下即是除了调用文件外的系统大体代码,有一定的参考价值。

@echo off
title=我的管理系统
:sys
cls
color 0f
echo ------------------------------------------------------
echo                      我的管理系统
echo ------------------------------------------------------
echo ---------1.桌面工具   -----------2.新的开始   --------
echo ------------------------------------------------------
echo ---------3.阅读书房   -----------4.百度云盘   --------
echo ------------------------------------------------------
echo ---------5.Qt crtator -----------6.VC++       --------
echo ------------------------------------------------------
echo ---------7.QQ         -----------8.酷狗音乐   --------
echo ------------------------------------------------------
echo ---------9.回收站     -----------10.实用工具  --------
echo ------------------------------------------------------
echo ---------11.魔比斯盒  -----------12.定时关机  --------
echo ------------------------------------------------------
echo ---------13.文件系统  -----------14.控制系统  --------
echo ------------------------------------------------------
echo ---------15.控制面板  -----------16.火狐浏览  --------
echo ------------------------------------------------------
echo ---------0.退出       -----------9420.关机.   --------
echo ------------------------------------------------------
echo ---------mm.password  -----------B.D:\BAT     --------
echo ------------------------------------------------------

set /p in=-----输入相应数字:
if /i "%in%"==""goto Erorr2
if /i "%in%"=="1" goto STR1
if /i "%in%"=="2" goto STR2
if /i "%in%"=="3" goto STR3
if /i "%in%"=="4" goto STR4
if /i "%in%"=="5" goto STR5
if /i "%in%"=="6" goto STR6
if /i "%in%"=="7" goto STR7
if /i "%in%"=="8" goto STR8
if /i "%in%"=="9" goto STR9
if /i "%in%"=="10" goto STR10
if /i "%in%"=="11" goto STR11 
if /i "%in%"=="12" goto STR12
if /i "%in%"=="13" goto STR13
if /i "%in%"=="14" goto STR14
if /i "%in%"=="15" goto STR15
if /i "%in%"=="16" goto STR16
if /i "%in%"=="0" goto 退出
if /i "%in%"=="b" goto BAT
if /i "%in%"=="c" goto callcmd
if /i "%in%"=="mm" goto password
if /i "%in%"=="9420" goto shutdown
if /i "%in%"=="DV2013" goto video
goto error

:STR1
start "" D:\桌面应用
goto sys
:STR2
start "" E:\新的开始
goto sys
:STR3
start "" "D:\Program Files\ii3\iRoom\iRoom.exe"
goto sys
:STR4
start "" D:\BaiduNetdisk\BaiduNetdisk.exe
goto sys
:STR5
start "" D:\Qt\Qt5.8.0\Tools\QtCreator\bin\qtcreator.exe 
goto sys
:STR6
start "" "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe"
goto sys
:STR7
start "" "D:\Program Files\Tencent\QQ\Bin\QQScLauncher.exe" 
goto sys
:STR8
start "" D:\KuGou2012\KuGou.exe
goto sys
:STR9
rem 这个是调用垃圾站的代码 explorer.exe ::{645FF040-5081-101B-9F08-00AA002F954E} goto sys :STR10 start "" D:\资料库\软件备份 goto sys :STR11 start D:\BAT\MBSH.bat goto sys :STR12 start ""D:\BAT\IFshutdown.txt goto sys :STR13 start "" D:\BAT\FileMG.bat goto sys :STR14 start "控制系统" D:\BAT\Dreams.bat goto sys :STR15 control.exe goto sys :STR16 start "" "D:\Program Files\Mozilla Firefox\firefox.exe" goto sys :callcmd start "" cmd|cd/d D:bat goto sys :video start D:\软件运用\Aipot exit :BAT start D:\BAT&&goto sys :password start "" notepad D:\BAT\File\Infofiles\password.DsFiles :退出 exit :shutdown shutdown /s /t 5 exit :Error2 echo --------------------------------------------- echo -----------------No Input--------------- echo --------------------------------------------- color 0a chioce /t 1/d y/n >nul goto sys :error echo --------------------------------------------- echo ---------输入错误--Ltaer Again--------- echo ---------------------------------------------- color 0a choice /t 1 /d y /n >nul goto sys

 

 以上是文章的主要内容,余下待更新……

 

转载于:https://www.cnblogs.com/Zcgyshui/p/9499246.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值