CMD
ä¹ ãã¶ãã®ãããã¹ã¯ãªãããã¿ã for /fã§ãã¡ã¤ã«ãèªãã¨ã空è¡ã®ç¡è¦ãã®ä»ããããåé¡ãããã®ã§ãã©ããªããã¹ããã¡ã¤ã«ã§ãèªãæ¹æ³ã @echo off setlocal enabledelayedexpansion set INFILE=XXXXXXXX set OUTFILE=YYYYYYYY for /f %%A in ('findâ¦
ç°å¢å¤æ°PATHã®å 容ã1é ç®1è¡ã§è¡¨ç¤ºããã ãã®éã«ãC:\Program Filesã§å§ã¾ãç©ã¯è¡¨ç¤ºããªãã åã«æ¹è¡ããã ããªããæååç½®æã§ç°¡åãæ¹è¡ã«ç½®æããéã«ã¯ãé 延ç°å¢å¤æ°ã«ããäºãå¿ è¦ã C:\Program Filesã®é¤å¤ã¯ãfindstr /vã§åºæ¥ãã°è¯ãããç½®â¦
ã³ãã³ãããã³ããã§ãaaa\..\foo.txtã¨å ¥åããã¨ãã«ã¬ã³ããã£ã¬ã¯ããªã«aaaã¨ãããã£ã¬ã¯ããªãããã°ããã®è¦ªã®foo.txtãªã®ã§çµå±ã«ã¬ã³ããã£ã¬ã¯ããªã®foo.txtãæ¡å¼µåã«é¢é£ä»ããããã°ã©ã ãèµ·åãã¦ãã¡ã¤ã«ãéãã®ã¯å½ç¶ã ã ããããaaaãåâ¦
ãCD ã³ãã³ãã®æ©è½æ¡å¼µ 第äºçã以æ¥ã16å¹´ã¶ãã®å¤§å¹ ä¿®æ£ãæ©è½ã¯å¤ãã¦ããªããããªãã¡ã¯ã¿ãªã³ã°ã§æ©è½è¿½å ãã·ã³ãã«ã«ãªã£ãã cdd.batã¨ããååã§ä½ã£ã¦ãdoskey cd=cdd $*ã§aliasãå®ç¾©ãã¦ä½¿ãã æ©è½ã¯ã 移åã¯ãã¹ã¦ pushd ã§è¡ãã cd ã®ã¿â¦
ã³ãã³ãããã³ããã®è²ã¯ãèæ¯ãé»ãæåãç½ã«ãã¦ããã®ã ããããã°ã©ã ã«ãã£ã¦ã¯ä»ã®è²ã®æåã表示ãããã ç½ä»¥å¤ã®æåãé»èæ¯ã«åºãã¨é常ã«èªã¿ã«ããã®ã§ãç½åºå®ã«ããã ã¾ããã¬ã¸ã¹ããªã Windows Registry Editor Version 5.00 [HKEY_CURâ¦
for %%A in (A B C D E) do call :sub goto :EOF :sub for %%B in (1 2 3 4 5) do echo %%A-%%B ã¬ãã·ã«ã«ã«ã¯ :sub ã¯ãfor %%A ã®ã«ã¼ãã®å¤ã ãã%%A ãåç §ã§ããï¼ ä»ã¾ã§ãå¼æ°ã§æ¸¡ãã¦ã¾ããããªãã¦ãã¨ã ã ããããgoto ãã㨠%%B ã ãã§ãªã %%â¦
ã¡ãã£ã¨ä¿¡ãããããã©ãå°ãªãã¨ãWindows7ã§ã¯ãforfilesã³ãã³ãã«ãã°ãããããã¹ããã¦ãªãã®ãï¼ /c ã§æå®ããå¤é¨ã³ãã³ãã®ç¬¬ä¸å¼æ°ãè½ã¡ãããã ãcmd /c ãæ¸ãã°åé¡ãªãã D:\foo>forfiles /c "gecho 1 2 3 @file" 2 3 bar 2 3 baz D:\foo>fâ¦
ãããã¹ã¯ãªããããä»ã®ãããã¹ã¯ãªãããå¼ã³åºãã¨ãã«ãcallã§å¼ã³åºããªãã¨æ»ã£ã¦ããªãç©ã ã¨æã£ã¦ããã <<foo.bat>> bar.bat echo foo ã»ã»ã»ã»ã»å®è¡ãããªã <<bar.bat>> echo bar ããããforã ã¨å®è¡ãããã <<foo.bat>> for %%A in (a b c) do bar.bat&echo foo ã»ã»</foo.bat></bar.bat></foo.bat>â¦
http://otnx.jp ã®ãµã¤ãããå ±ç¨ã¬ã³ã¿ã«ãµã¼ãã¼ãããVPSã«ç§»è¡ããã æ¬æ¥ãDNS ã®ç»é²å¤æ´ã ããããã¨ãããã移è¡ãããã¨æã£ã¦ããã2å¹´åæ¾ã£ã¦ãããã®ãããããããã¨ã¾ã ã¡ã¼ãªã³ã°ãªã¹ãã®ç§»è¡ãããã
ä»ã¾ã§ãfor /f ã³ãã³ãã® eol= ãªãã·ã§ã³ã«ã¤ãã¦ã¯ç¡è¦ãã¦ãããããã¯ãèªã¿è¾¼ãã è¡ã®è¡é ã®æåã«ãã£ã¦èªã¿é£ã°ãæ©è½ã ããããã©ã«ãã®æåãã;ãï¼ã»ãã³ãã³ï¼ã§ããããªã®ã§ãæä½ã£ãhead.batãtail.batã§ã¯ã空è¡ã ãã§ãªãè¡é ãã»ãã³ãâ¦
find ã§ã¯é·ãè¡ãæ±ããªãããã ã C:\>ruby -e "5.times{puts '@'*4094}" | find "@" | ruby -nle "puts $_.size" 4094 4094 4094 4094 4094 C:\>ruby -e "5.times{puts '@'*4095}" | find "@" | ruby -nle "puts $_.size" 20474 C:\> æ¹è¡ãå«ãã§4096ã¾â¦
/? ã®åé é¨åã ãè¼ããã ã¾ããCMDã®ãã«ãã¤ã³ã³ãã³ãã§å¢ããç©ã¯ãhelp ã®åºåãæ¯è¼ãã¦å¤é¨ã³ãã³ããé¤ãã¦ã¿ãã¨ãï¼ã¤ã ãã MKLINK ã·ã³ããªã㯠ãªã³ã¯ãä½æãã¾ãã MKLINK [[/D] | [/H] | [/J]] ãªã³ã¯ ã¿ã¼ã²ãã /D ãã£ã¬ã¯ããªã®ã·ã³ãâ¦
ç¥ããªãã£ãã AT ã³ãã³ãã¯ã·ã¹ãã ã¦ã¼ã¶ã§å®è¡ããããããã¿ã¹ã¯ãã®ç»é¢ã®è©³ç´°è¨å®ã¡ãã¥ã¼ã§ãATå®è¡æã®ã¦ã¼ã¶ãæå®ã§ããï¼
ãµã¨PATHEXEã«.ã ãã追å ããã®ãæãã¤ãã¦ãã£ã¦ã¿ããæå¤ãªãã¨ã«ãã¾ãããã¾ããã ã¾ããã·ã¹ãã ã®ããããã£ãããç°å¢å¤æ° PATHEXT ã®æå¾ã« ;. ï¼ã»ãã³ãã³ã¨ããªãªã)ã追å ãã¾ã 次ã«ãããRubyãã¤ã³ã¹ãã¼ã«ããã¦ããªããã°ã¤ã³ã¹ãã¼ã«â¦
Firefoxã®èµ·åã»çµäºãéãããããã«ãsqliteãã¼ã¿ãåä½æã»å§ç¸®ããã¨ããã®ãæµè¡ã£ã¦ããï¼ãããªã®ã§ãä¹ã£ã¦ã¿ãããµã¤ãºãå°ããããããã«ã¯ä¸åº¦åé¤ãã¦åä½æãããã¨ããã®ã ããããã¯ããããã¼ã¿ã失ããããªã©é£ããã ãã£ãããããå ´åâ¦
%TIME%ã®å é ããæå»ã10æ以åã®æ空ç½ã«ãªãã®ã¯ä¸ä¾¿ã ã¨æã£ã¦ãããã©ããããªã£ã¦ããçç±ã«ã¤ããã£ãæãå½ãã£ãã%TIME:~0,2% ãåãåºãã¦ãããã ãã使ã£ã¦è¨ç®ããã大å°æ¯è¼ããã¨ãã«å é ã¼ãã§ãªãæ¹ãåç´ã ãä»ã¾ã§ãYYYYmmddHHMMSS ã®ãâ¦
C:\temp>jpegtopnm a.jpg | pnmtopng > a.png jpegtopnm: WRITING PPM FILE C:\temp>C:\gnu\bin\jpegtopnm a.jpg | C:\gnu\bin\pnmtopng > a.png C:\gnu\bin\pnmtopng: Unable to create temporary file. mkstemp() failed with errno 22 (Invalid argument)â¦
ä¹ ã ã®ãããã¹ã¯ãªãããã¨ããããããã°èªä½ã2ã¶æã¶ããããããªã¬ã³ã¼ãã¼ã¯ãæ±èRDæ©ã使ã£ã¦ããããããã«ã¯ããã©ã«ã解ä½ãã¨ããæ©è½ãããããã©ã«ãã®ä¸ã®ãã¡ã¤ã«ãå¤ã«åºãã¦ããã©ã«ãã空ã«ãã¦ãããã®ãã©ã«ããåé¤ãããããã¯ãWindâ¦
http://otnx.jp/CMD/ ã®ãµã¤ãã«ä»æè±èªã§ã®ã³ã¡ã³ãã2件ããããããè¤ãã®è¨èãããã ããã googleã§ç¿»è¨³ãã¦èªãã§ããããã ãã©ãç¶ãã¦2件æ¥ãã¨è¨ããã¨ã¯ã©ããã«ãªã³ã¯ããã¦ããã®ãï¼ãããgoogleã®ãªã³ã¯æ¤ç´¢ã§ã¯å¼ã£ããããã
NIFTYã®æ²ç¤ºæ¿ãããã¾ã for /f ã®ãã°ã§ãããWin2000/SP4ãWinXP/SP1,SP2ã§åºãã2003ã¯æªç¢ºèªã ã³ãã³ãããã³ãããéãã¦ããã®ã¹ã¯ãªãããé£ç¶å®è¡ããã¨ãä¸æè°ãªç¾è±¡ãèµ·ããã @echo off for /f "usebackq tokens=1-4" %%A in ('aa bb cc dd') â¦
ä¹ ãã¶ãã« http://otnx.jp/CMD/ ã«ã¢ã¯ã»ã¹ãã¦ã¿ãã¨ããã¼ã¸ã表示ãããªããä¸è¦§ã¯åºããã®ã®ãã©ã®ãã¼ã¸ã空ç½ã§ãããããããã¯ã©ãã«ã¼ã«ãããããã¨ãã°ãè¦ã¦ãããããã形跡ã¯ç¡ããããã¡ã¤ã«ã®ä¸èº«ãç´æ¥è¦ãã¨ã¡ããã¨ããããµã¨ããããã¤â¦
ãµã¨ãWindowsXP㧠dir " " ãæã£ã¦è¦ãã C:\WINDOWS\TEMP>dir " " ãã¡ã¤ã«åã¾ãã¯æ¡å¼µåãé·ããã¾ãã C:\WINDOWS\TEMP>type " " æå®ããããã¹ãè¦ã¤ããã¾ããã C:\WINDOWS\TEMP>echo > " " æå®ããããã¹ãè¦ã¤ããã¾ãããå°ãªãã¨ã dir ã®ã¯â¦
éåéãéããããã¾ã«ã¯CMDãã¿ãæ¸ããªãã¨ãCçã§ããã°ã©ã ãæ¸ãæã¯ããã¡ã¤ã«ã®ãã¹åºåãæåã« \ ã ãã§ãªãã/ ã使ããããã ããã³ãã³ãããã³ããããã§ã¯ã/ ã¯ãªãã·ã§ã³ã®æå®ã«ä½¿ããã¦ããã±ã¼ã¹ãå¤ãã使ããªããã¨ãå¤ãã ããããâ¦
ç¥ããªããã¡ã«ãã¯ã¦ãªããããã¨ãããã®ãåºæ¥ã¦ãããSNSã®ã³ãã¥ããã£ã¼ç¸å½ãªæ°ãããããã¯ã¦ãªãã¤ã¢ãªã¼ä»¥å¤ã®blogãåå ã§ãããã¨ããããããCMDEXEãã¨ãããªã³ã°ãä½ã£ã¦ã¿ãããã®ãã¼ã¸ã«ãªã³ã°ã¸ã®ãªã³ã¯ã¢ã¸ã¥ã¼ã«ãã¤ãã¦ã¿ããã表示ãâ¦
ã¢ã¯ã»ã¹è§£æ(ã¯ã¦ãªã«ã¦ã³ã¿ã¼)ãè¦ã¦ããã¨ãæ¤ç´¢ããã¯ã¦ãªãã¼ã¯ã¼ããããå¤ãã®ã§ãããããã¯ãã¼ã¯ããæ¥ã¦ããã¨æãããã¢ã¯ã»ã¹ãããããããã¾ãããããã人ã£ã¦ããã¬ã話ãèªã¿ãããããããªãã¦ãCMD.EXE Tips ãèªã¿ãããã§ããããå¤åâ¦
net use X: \\host\share /user:watashi himitsu copy X:\not-exist-file . net use X: /delete ãå®è¡ããã¨ãããªãã®ç¢ºç㧠net use /delete ã失æãããcopy ãæåããã±ã¼ã¹ã§ã¯å¤±æã¯èµ·ãããªã(å ¨ãèµ·ãããªãã®ãã©ããã¯ä¸æ)ãã¾ããcopy ã®å¾ã«â¦
æè¿TVã®è©±ãç¶ããã®ã§ãä¹ ã ã« CMD ããã§ãæ¸ãã¦ã¿ããæè¿ãã¾ããããæãã¤ããªããã ãããé¡ãã%RANDOM% ã§ä¹±æ°ãå¾ãããããã ããããã®ã·ã¼ãå¤ã¯ã©ããªã£ã¦ããã®ãã 試ãã¦ã¿ãã¨ããªã㨠æåç§ ãå ã«ä½ã£ã¦ããããã§ãããããããæå»â¦
å°ãåã«ãhttp://otnx.jp/CMD/%C1%B4%C8%CC%2F%B9%BD%CA%B8%B2%F2%C0%CF ã«æ§æ解æã®ãã¨ãã¾ã¨ãã¦çµãã£ãæ°ã«ãªã£ã¦ããããã¾ã ã¾ã ã®ããã ã for /f "delims=" %%A in ("echo ABC&date/t") do %%A âABC&date/t ã¨è¡¨ç¤º for /f "delims=" %%A in ("echâ¦
id:otn:20041216 ã§ãã(echo)ã®ç©ºç½ä»å ã®è¬ããæ¸ããããecho ãæ¬å¼§ã§å²ãã ä¸ã«ãã¤ãã§ä½¿ãã±ã¼ã¹ãããã®ãã¨ããåé¡ãä¾ãã°ãTCP.EXE ã使ã£ã¦ã¡ã¼ã«ã®ãã§ãã¯ãããã±ã¼ã¹ã TCP.EXEã¯ã"Mule for Win32" ã®ãã¤ããªããã±ã¼ã¸ã«å ¥ã£ã¦ããããâ¦
id:otn:20041216 ã§ãã(echo)ã®ç©ºç½ä»å ã®è¬ãã¨ããã®ãæ¸ãããã set