复制代码
- @echo off
- ::脚本维护: 523066680@bathome.net
- ::首要判断
- if "%1"=="" (goto :func_info)
- setlocal enabledelayedexpansion
- set "dest=%userprofile%\CmdParcel"
- rem 已经存在的话就不用搞了
- if exist "%windir%\system32\%1" (echo %windir%\system32 下已经存在%1 &exit /b)
- if exist "%dest%\%1" (echo %dest% 下已经存在 %1 &exit /b)
- set cmd_edit=edit
- set cmd_info=info
- set cmd_clear=clear
- set cmd_help=help
- set cmd_set=set
- if defined cmd_%1 (goto :func_%1) else (echo 将尝试从已知资源中下载%1)
- if not exist "%userprofile%\CmdParcel" (md %userprofile%\CmdParcel)
- ::::需要调用set的模块::范围标签::::
- call :set
- if defined c_%1 (
- if exist "%dest%\!c_%1!" (echo %dest% 下已经存在该包裹了 &goto :ParcelExist)
- echo 下载源: %link_act%
- cd /d %dest%
- wget -O "%dest%\!c_%1!" %link_act%/!c_%1!
- if exist "%dest%\!c_%1!" (
- goto :ParcelExist
- ) else (貌似是没有下载成啊! &exit /b)
- ) else (
- echo 还没有收集到该命令下载连接,或参数错误。
- exit /b
- )
- :ParcelExist
- set "unrar=c:\program files\winRAR\unrar.exe"
- if not exist "%unrar%" (echo 没有找到解压工具unrar.exe 需要重新配置 &exit /b)
- echo 尝试通过 %unrar% 对下载的压缩文件进行解压:
- "%unrar%" x -o- "%dest%\!c_%1!" "%dest%\" >nul
- rem 关于目标文件是否存在的判断,之前已经做过+相应处理了。下面只管解压
- if %errorlevel%==0 (echo 解压完成) else (echo 貌似出了错,分析失误的代码尚未完善。)
- exit /b
- ::::::结束标签:::::::
- :func_edit
- start notepad "%~sf0"
- exit /b
- :func_info
- echo 本脚本下载资源来自 http://www.vkill.net/tools
- echo 该页面包含对第三方命令的注释,版本等信息,比较全面。
- echo getcmd.bat将来的版本会尝试制作第三方命令信息查询机制。
- echo 下载的压缩文件以及解压后文件都将放在%dest%目录中
- echo _
- echo 为了可以在其他目录中调用命令,请执行本脚本的 set 参数
- exit /b
- :func_clear
- echo 此命令将清除所有下载过的压缩文件。
- dir /s /b "%dest%\*.rar" 2>nul
- del "%dest%\*.rar"
- exit /b
- :func_help
- echo help 显示帮助
- echo info
- echo edit
- echo clear
- echo 第三方命令名称.后缀 下载第三方命令。
- exit /b
- :func_set
- ::本处的wmic语句直接复制修改于zqz帖子中的示例
- if "!path:%dest%=!"=="!path!" (
- wmic ENVIRONMENT where "name='path' and username='<SYSTEM>'" set VariableValue='%path%;%dest%'
- ) else (echo 环境变量path中已经包含%dest%了。)
- exit /b
- :set
- set link_act=http://www.vkill.net/tools
- set c_ab.exe=ab_2.0.55.0.rar
- set c_blat.exe=blat_2.6.1.rar
- set c_curl.exe=curl_7.12.2.rar
- set c_dialupass.exe=dialupass_2.43.rar
- set c_Downloader.exe=Downloader_3.01.rar
- set c_febootimail.exe=febootimail_1.3.rar
- set c_hunt.exe=hunt_1.2.rar
- set c_idman.exe=idman_5.08.rar
- set c_mt.exe=mt_.rar
- set c_NBTscanIpanto.exe=NBTscanIpanto_1.0.3.rar
- set c_ncftp.exe=ncftp_3.2.0.rar
- set c_nc.exe=nc_1.10.rar
- set c_nmap.exe=nmap_4.11.rar
- set c_PortQry.exe=PortQry_2.0.rar
- set c_PortReporter.exe=PortReporter_.rar
- set c_pstools.exe=pstools_2.2.rar
- set c_smac.exe=smac_1.0.rar
- set c_sssyg.exe=sssyg_.rar
- set c_t4etools.exe=t4etools_.rar
- set c_wget.exe=wget_1.10.2.rar
- set c_wget.exe=wget_1.82.rar
- set c_wol.exe=wol_1.2.rar
- set c_XmlSendmail.exe=XmlSendmail_1.4.1.rar
- set c_CCase.exe=CCase_2.5.rar
- set c_ConCmd.exe=ConCmd_1.5.rar
- set c_gawk.exe=gawk_3.1.3.rar
- set c_gawk.exe=gawk_3.1.5.rar
- set c_grep.exe=grep_2.5.1.rar
- set c_HtoX32c.exe=HtoX32c_1.73.rar
- set c_LineX.exe=LineX_2.5.rar
- set c_mtee.exe=mtee_2.0.rar
- set c_sed.exe=sed_4.0.7x.rar
- set c_sed.exe=sed_4.1.4b.rar
- set c_sed.exe=sed_4.1.5.rar
- set c_split.exe=split_.rar
- set c_ssed.exe=ssed_3.6.2.rar
- set c_Str.exe=Str_2.5.rar
- set c_Tee.exe=Tee_2.5.rar
- set c_wfr.exe=wfr_2.3.1.120.rar
- set c_xmlstarlet.exe=xmlstarlet_1.0.1.rar
- set c_7za.exe=7za_4.42.rar
- set c_aefdisk32.exe=aefdisk32_1.2.rar
- set c_aio.exe=aio_1.0.rar
- set c_autorunsc.exe=autorunsc_8.61.rar
- set c_BalloonTip.exe=BalloonTip_.rar
- set c_base64.exe=base64_1.0.rar
- set c_beyondexecv.exe=beyondexecv_2.05.rar
- set c_cdr.exe=cdr_.rar
- set c_chknic.exe=chknic_.rar
- set c_cmdow.exe=cmdow_1.4.3.rar
- set c_ColorX.exe=ColorX_2.5.rar
- set c_CompInfo.exe=CompInfo_1.01.rar
- set c_contig.exe=contig_1.53.rar
- set c_ctext.exe=ctext_2K.232.rar
- set c_datapipe.exe=datapipe_.rar
- set c_DateX.exe=DateX_2.5.rar
- set c_dd.exe=dd_0.3.rar
- set c_dd.exe=dd_0.4beta5.rar
- set c_DevCon.exe=DevCon_.rar
- set c_dirsize.exe=dirsize_4.8.rar
- set c_DriveX.exe=DriveX_2.5.rar
- set c_EchoX.exe=EchoX_2.5.rar
- set c_EmptyRecycleBin.exe=EmptyRecycleBin_1.0.rara
- set c_filever.exe=filever_5.1.2600.0.rar
- set c_FInfo.exe=FInfo_2.5.rar
- set c_forfiles.exe=forfiles_.rar
- set c_FPipe.exe=FPipe_2.1.rar
- set c_fsum.exe=fsum_2.51.rar
- set c_hide1.exe=hide1_.rar
- set c_instsrv.exe=instsrv_.rar
- set c_inuse.exe=inuse_1.4.rar
- set c_ipsec.exe=ipsec_.rar
- set c_knlsc.exe=knlsc_1.3.rar
- set c_lads.exe=lads_4.00.rar
- set c_logname.exe=logname_.rar
- set c_md5.exe=md5_2.0.rar
- set c_MessageBox.exe=MessageBox_.rar
- set c_mirror.exe=mirror_1.42.rar
- set c_mport.exe=mport_1.3.rar
- set c_mstsc.exe=mstsc_Vista5744.rar
- set c_nircmd.exe=nircmd_1.83.rar
- set c_openports.exe=openports_1.0.rar
- set c_physdiskwrite.exe=physdiskwrite_0.5.rar
- set c_pk.exe=pk_1.04.rar
- set c_pmon.exe=pmon_.rar
- set c_procmon.exe=procmon_1.12.rar
- set c_pv.exe=pv_3.11.1.1.rar
- set c_qres.exe=qres_1.1.rar
- set c_QueryAutoRun.exe=QueryAutoRun_1.0.rar
- set c_Rar.exe=Rar_3.70beta4.rar
- set c_reg2inf.exe=reg2inf_.rar
- set c_REGFONT.exe=REGFONT_1.1.rar
- set c_regini.exe=regini_.rar
- set c_regjump.exe=regjump_1.01.rar
- set c_rinetd.exe=rinetd_0.61.rar
- set c_runassrv.exe=runassrv_1.0.0.3.rar
- set c_runassrv.exe=runassrv_1.1.0.628.rar
- set c_scanreg.exe=scanreg_1.05.rar
- set c_setacl.exe=setacl_0.87.rar
- set c_setacl.exe=setacl_2.0.2.0.rar
- set c_setres.exe=setres_1.0.rar
- set c_sha1.exe=sha1_1.0.rar
- set c_shortcut.exe=shortcut_1.11.rar
- set c_showacls.exe=showacls_.rar
- set c_SleepX.exe=SleepX_2.5.rar
- set c_sox.exe=sox_12.18.1.rar
- set c_srvinfo.exe=srvinfo_3.00.10.rar
- set c_TrayBalloon.exe=TrayBalloon_.rar
- set c_unplug.exe=unplug_0.098.rar
- set c_upx.exe=upx_2.03w.rar
- set c_VidChng.exe=VidChng_1.0.rar
- set c_vidc.exe=vidc_2.0.rar
- set c_wait.exe=wait_1.4.rar
- set c_winclip.exe=winclip_.rar
- set c_XXCopy.exe=XXCopy_2.93.1.rar
- set c_httpsv.exe=httpsv_1.6.2.rar
- set c_http.exe=http_1.1.rar
- set c_shttpd.exe=shttpd_1.26.rar
- set c_SlimFTPd.exe=SlimFTPd_3.17.rar
- set c_SlimFTPd.exe=SlimFTPd_3.181.rar
- set c_TinyFTPD.exe=TinyFTPD_1.4.rar
- set c_zxftpd.exe=zxftpd_.rar
- set c_mpg123.exe=mpg123_0.59r.rar
- set c_mplayerc.exe=mplayerc_6.4.9.0.rar
- set c_mplayer.exe=mplayer_1.0pre8.rar
- set c_CmdBurn.exe=CmdBurn_3.3.1.rar
- set c_csv2xml.exe=csv2xml_1.02.rar
- set c_epsnap.exe=epsnap_2.1.0.1550.rar
- set c_Image2PDF.exe=Image2PDF_1.83a.rar
- set c_ImageConsole.exe=ImageConsole_.rar
- set c_ImageMagick.exe=ImageMagick_6.3.3-3.rar
- set c_Notify.exe=Notify_1.0.rar
- set c_p2wagent.exe=p2wagent_2.1.rar
- set c_playRTPMPEG.exe=playRTPMPEG_.rar
- set c_PngMate.exe=PngMate_2.0.rar
- set c_webshot.exe=webshot_1.36.rar
- set c_xml2csv.exe=xml2csv_1.31.rar
- goto :eof
欢迎光临 批处理之家 (http://bathome.net./) | Powered by Discuz! 7.2 |