﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-领星动网编程开发之爆炸小宇宙-随笔分类-CMD</title><link>http://www.cnitblog.com/lxasp/category/8982.html</link><description>cnitblog.com/lxasp  -  -   有一种信念叫做编程</description><language>zh-cn</language><lastBuildDate>Wed, 18 Oct 2023 01:50:15 GMT</lastBuildDate><pubDate>Wed, 18 Oct 2023 01:50:15 GMT</pubDate><ttl>60</ttl><item><title>创建畸形目录和复制文件的可行实用方法（WIN7/WIN10）2023年10月亲测可用</title><link>http://www.cnitblog.com/lxasp/archive/2023/10/15/96744.html</link><dc:creator>lxasp</dc:creator><author>lxasp</author><pubDate>Sun, 15 Oct 2023 15:29:00 GMT</pubDate><guid>http://www.cnitblog.com/lxasp/archive/2023/10/15/96744.html</guid><wfw:comment>http://www.cnitblog.com/lxasp/comments/96744.html</wfw:comment><comments>http://www.cnitblog.com/lxasp/archive/2023/10/15/96744.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/lxasp/comments/commentRss/96744.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/lxasp/services/trackbacks/96744.html</trackback:ping><description><![CDATA[<div style="background-color: #eeeeee; font-size: 13px; border-color: #cccccc; border-image: initial; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
-->手动在cmd创建畸形目录输入命令：<br />
md&nbsp;autorun.inf<br />
cd&nbsp;autorun.inf<br />
md&nbsp;\\?\%cd%\.<br />
md&nbsp;\\?\%cd%\..<br />
md ...\<br />
<br />
复制进文件时：<br />
cd&nbsp;autorun.inf\...\...\<br />
copy&nbsp;c:\tmp\1\*.*<br />
<br />
复制出文件时：<br />
cd&nbsp;autorun.inf\...\...\<br />
copy&nbsp;*.*&nbsp;c:\tmp\2\</div>
<br />注意：必须在CMD里使用。在资源管理器可以看见&#8220;...&#8221;但不能&#8220;正常&#8221;使用该目录（无法删除也无法复制出里面的文件）。&nbsp;<br /><br />&nbsp;<img src ="http://www.cnitblog.com/lxasp/aggbug/96744.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/lxasp/" target="_blank">lxasp</a> 2023-10-15 23:29 <a href="http://www.cnitblog.com/lxasp/archive/2023/10/15/96744.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CAB压缩解压工具箱 -- 用批处理实现的CAB压缩解压程序</title><link>http://www.cnitblog.com/lxasp/archive/2023/09/28/96737.html</link><dc:creator>lxasp</dc:creator><author>lxasp</author><pubDate>Thu, 28 Sep 2023 13:44:00 GMT</pubDate><guid>http://www.cnitblog.com/lxasp/archive/2023/09/28/96737.html</guid><wfw:comment>http://www.cnitblog.com/lxasp/comments/96737.html</wfw:comment><comments>http://www.cnitblog.com/lxasp/archive/2023/09/28/96737.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/lxasp/comments/commentRss/96737.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/lxasp/services/trackbacks/96737.html</trackback:ping><description><![CDATA[用批处理实现的CAB压缩解压程序。可兼容在XP/2003/Win7/Win10使用。<br />
<br />
主要的两个文件：<br />
2cabexp.cmd&nbsp; &nbsp; --解压CAB压缩包文件到&#8220;我的文档&#8221;目录里，可支持拖放。在XP需要用本工具箱里的expand.exe和dpx.dll才可支持带目录结构的CAB文件解压。<br />
<br />
2cabmkp.cmd&nbsp; &nbsp;--将目录或文件生成CAB压缩包文件的批处理，可支持拖放。<br />
<br />
两个批处理都支持方便的拖放功能。在资源管理器中将所需文件拖放到2cabexp.cmd或2cabmkp.cmd的文件名中即可方便解压或压缩。<br />
<br />
<span style="background-color: #ffffff; font-size: 14pt;">CAB压缩解压批处理工具箱</span><span style="font-size: 14pt;">下载：&nbsp;</span><a href="/Files/lxasp/cabmkmenu_202309122102.zip"><strong style="color: #3366ff; font-size: 14pt;"><u><em>cabmkmenu_202309122102.zip</em></u></strong></a><br />
<br />
实现CAB压缩的重要参数设置如下：<br /><div style="background-color: #eeeeee; font-size: 13px; border-color: #cccccc; border-image: initial; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->.OPTION&nbsp;EXPLICIT<br />.Set&nbsp;InfFileName=NUL<br />.Set&nbsp;RptFileName=NUL<br />.Set&nbsp;DestinationDir=<br />.Set&nbsp;CabinetName1="%~nx1.CAB"<br />.Set&nbsp;CabinetNameTemplate="%~nx1*.CAB"<br />.Set&nbsp;DiskDirectoryTemplate="%~dp1."<br />.Set&nbsp;UniqueFiles=OFF<br />.Set&nbsp;FolderSizeThreshold=2147483648<br />.Set&nbsp;MaxDiskSize=0<br />.Set&nbsp;Cabinet=on<br />.Set&nbsp;Compress=on<br />.Set&nbsp;CompressionType=LZX<br />.Set&nbsp;CompressionMemory=21</div><br />
FolderSizeThreshold=2147483648&nbsp; --这个就是单个CAB压缩包文件支持的最大容量（2GB）。<br /><br />&nbsp;&nbsp;<img src ="http://www.cnitblog.com/lxasp/aggbug/96737.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/lxasp/" target="_blank">lxasp</a> 2023-09-28 21:44 <a href="http://www.cnitblog.com/lxasp/archive/2023/09/28/96737.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>nop exe Windows executable that does nothing 什么都不做的空操作的无窗口的EXE可执行文件 (3 editions)</title><link>http://www.cnitblog.com/lxasp/archive/2023/09/28/96736.html</link><dc:creator>lxasp</dc:creator><author>lxasp</author><pubDate>Thu, 28 Sep 2023 01:15:00 GMT</pubDate><guid>http://www.cnitblog.com/lxasp/archive/2023/09/28/96736.html</guid><wfw:comment>http://www.cnitblog.com/lxasp/comments/96736.html</wfw:comment><comments>http://www.cnitblog.com/lxasp/archive/2023/09/28/96736.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/lxasp/comments/commentRss/96736.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/lxasp/services/trackbacks/96736.html</trackback:ping><description><![CDATA[Windows Executable Program that does nothing, source included.<br />
Here is a Windows exe that does nothing without black cmd window or anything else.<br />
There are three editions here: a normal size 2048 bytes, a small size 1536 bytes, a micro size 523 bytes.<br />
<br />
<br />
什么都不做的空操作的无窗口的EXE可执行文件--可用于替换不要常驻进程的EXE<br />
<br />
含有3个版本：常规版的EXE，2048字节；缩小版的EXE，1536字节；微小版的EXE，523字节。<br />
<br />
<strong style="font-size: 14pt;">【下载】Download:&nbsp;<a href="/Files/lxasp/nop-exe-nul-exe-w32.zip"><span style="color: #3366ff;"><em><u>nop-exe-nul-exe-w32.zip</u></em></span></a></strong><br /><br />&nbsp;<img src ="http://www.cnitblog.com/lxasp/aggbug/96736.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/lxasp/" target="_blank">lxasp</a> 2023-09-28 09:15 <a href="http://www.cnitblog.com/lxasp/archive/2023/09/28/96736.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CMD BAT 批处理技术：获得“我的文档”目录路径＋获得随机数＋字符串替换去除截取＋取字符串长度</title><link>http://www.cnitblog.com/lxasp/archive/2023/08/29/96721.html</link><dc:creator>lxasp</dc:creator><author>lxasp</author><pubDate>Tue, 29 Aug 2023 07:54:00 GMT</pubDate><guid>http://www.cnitblog.com/lxasp/archive/2023/08/29/96721.html</guid><wfw:comment>http://www.cnitblog.com/lxasp/comments/96721.html</wfw:comment><comments>http://www.cnitblog.com/lxasp/archive/2023/08/29/96721.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/lxasp/comments/commentRss/96721.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/lxasp/services/trackbacks/96721.html</trackback:ping><description><![CDATA[&nbsp;<span style="background-color: #ffffff;">获得&#8220;我的文档&#8221;目录路径：<br />
</span>
<div style="background-color: #eeeeee; font-size: 13px; border-color: #cccccc; border-image: initial; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><span style="color: #0000FF; ">FOR</span>&nbsp;/F&nbsp;"TOKENS=1,2&nbsp;DELIMS=:"&nbsp;%%A&nbsp;IN&nbsp;(<span style="color: #008000; ">'</span><span style="color: #008000; ">REG&nbsp;QUERY&nbsp;"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell&nbsp;Folders"&nbsp;/v&nbsp;Personal')&nbsp;DO&nbsp;(SET&nbsp;"DC=%%A"&amp;SET&nbsp;"DS=%%B")</span><span style="color: #008000; "><br />
</span><span style="color: #0000FF; ">SET</span>&nbsp;DS=%DC:~-1,1%:%DS%</div>
<br />
&nbsp;<span style="background-color: #ffffff;">获得随机数：</span><br />
<div style="background-color: #eeeeee; font-size: 13px; border-color: #cccccc; border-image: initial; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #0000FF; ">SET</span>&nbsp;/a&nbsp;<span style="color: #0000FF; ">rnd</span>=%random%%%(30000-10000+1)+10000</div>
<br />
&nbsp;取字符串后缀最后一个字符并判断是否含有斜杠\ 为字符串末尾自动加上斜杠\<br />
<div style="background-color: #eeeeee; font-size: 13px; border-color: #cccccc; border-image: initial; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #0000FF; ">SET</span>&nbsp;DZ=%DQ:~-1%<br />
<span style="color: #0000FF; ">IF</span>&nbsp;<span style="color: #0000FF; ">NOT</span>&nbsp;"%DZ%"=="\"&nbsp;(<span style="color: #0000FF; ">SET</span>&nbsp;"DQ=%DQ%\"&amp;<span style="color: #0000FF; ">SET</span>&nbsp;"DZ=")</div>
<br />
&nbsp;字符串替换去除双引号<br />
<div style="background-color: #eeeeee; font-size: 13px; border-color: #cccccc; border-image: initial; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #0000FF; ">SET</span>&nbsp;ST=%ST:"=%</div>
<br />
&nbsp;字符串替换空格为0 字符串去除冒号: 字符串去除点号.<br />
<div style="background-color: #eeeeee; font-size: 13px; border-color: #cccccc; border-image: initial; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #0000FF; ">SET</span>&nbsp;MT=%<span style="color: #0000FF; ">time</span>%<br />
<span style="color: #0000FF; ">SET</span>&nbsp;MT=%MT::=%<br />
<span style="color: #0000FF; ">SET</span>&nbsp;MT=%MT:.=0%<br />
<span style="color: #0000FF; ">SET</span>&nbsp;MT=%MT:&nbsp;=0%<br />
ECHO&nbsp;%MT%</div>
<br />
&nbsp;取得参数路径的属性并判断是否为文件夹目录<br />
<div style="background-color: #eeeeee; font-size: 13px; border-color: #cccccc; border-image: initial; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #0000FF; ">SET</span>&nbsp;ATT=%~A1<br />
<span style="color: #0000FF; ">SET</span>&nbsp;ATT=%ATT:~0,1%<br />
<span style="color: #0000FF; ">IF</span>&nbsp;/I&nbsp;"%ATT%"=="d"&nbsp;<span style="color: #0000FF; ">SET</span>&nbsp;TAR=%~F1\</div>
<br />
&nbsp;取得字符串长度<br />
<div style="background-color: #eeeeee; font-size: 13px; border-color: #cccccc; border-image: initial; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
-->@ECHO&nbsp;OFF<br />
<span style="color: #0000FF; ">SET</span>&nbsp;/P&nbsp;STR=请输入任意长度字符串：<br />
<span style="color: #0000FF; ">IF</span>&nbsp;<span style="color: #0000FF; ">NOT</span>&nbsp;DEFINED&nbsp;STR&nbsp;<span style="color: #0000FF; ">GOTO</span>&nbsp;:EOF<br />
<span style="color: #0000FF; ">SET</span>&nbsp;TLEN=0<br />
:LBLEN<br />
<span style="color: #0000FF; ">SET</span>&nbsp;/A&nbsp;TLEN+=1<br />
<span style="color: #0000FF; ">SET</span>&nbsp;STR=%STR:~0,-1%<br />
<span style="color: #0000FF; ">IF</span>&nbsp;DEFINED&nbsp;STR&nbsp;<span style="color: #0000FF; ">GOTO</span>&nbsp;:LBLEN<br />
ECHO&nbsp;字符串长度(字符个数)：%TLEN%<br />
PAUSE</div>
<br />
可以一行内写多个SET变量的情况：SET 加双引号，并且在同一行内不可引用同一行内其他的变量。<br />
因为当前行的变量内容要在本行结束后才生效。但是，从文本长度大小来算，加双引号在同一行写的，比直接回车的字节要多。<br />
两个双引号和&amp;共3个字节，而回车换行CRLF是2个字节。<br />
<div style="background-color: #eeeeee; font-size: 13px; border-color: #cccccc; border-image: initial; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #0000FF; ">SET</span>&nbsp;/A&nbsp;"RA=%RANDOM%%%(30000-10000+1)+10000"&amp;<span style="color: #0000FF; ">SET</span>&nbsp;"TA=%~A1"&amp;<span style="color: #0000FF; ">SET</span>&nbsp;"TD=%~D1"</div>
&nbsp;<img src ="http://www.cnitblog.com/lxasp/aggbug/96721.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/lxasp/" target="_blank">lxasp</a> 2023-08-29 15:54 <a href="http://www.cnitblog.com/lxasp/archive/2023/08/29/96721.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>