cmd.exeã§ãã¤ãã使ãå ´åã®æ³¨æç¹
Windowsã®cmd.exeã§ãã¤ãã使ãå ´åã®æ³¨æç¹ã«ã¤ãã¦æ¸ãã¾ãã*1
cmd.exeã®ãã¤ã
以ä¸ã®2ã¤ã®ã³ãã³ãå®è¡ã¯ãåºæ¬çã«åãåä½ã¨ãªãã¾ãã(åè ã¯ãã¤ããå¾è ã¯ä¸æãã¡ã¤ã«ã使ç¨)
- ã³ãã³ãA | ã³ãã³ãB
- ã³ãã³ãA > tmp & ã³ãã³ãB < tmp
ããããæ±ããã¼ã¿ã«ãã£ã¦ã¯ã2ã¤ã®éã§çµæã«éããåºãå ´åãããã¾ãã*2
ãã¹ã1
åãã«ãçµæã«éããåºãªãã±ã¼ã¹ããã¹ããã¾ãã次ã®3ã¤ã®ã³ãã³ãå®è¡ãè¦ã¦ãã ããã
C:\>echo %OS% Windows_NT C:\>echo %OS% | more Windows_NT C:\>echo %OS% > tmp & more < tmp Windows_NT
- 1çªç®
- ç°å¢å¤æ°OSã®å¤ããåç´ã«è¡¨ç¤ºãã¾ãã
- 2çªç®
- ç°å¢å¤æ°OSã®å¤ãããã¤ããçµç±ãã¦moreã§è¡¨ç¤ºãã¾ãã
- 3çªç®
- ç°å¢å¤æ°OSã®å¤ããä¸æãã¡ã¤ã«ãçµç±ãã¦moreã§è¡¨ç¤ºãã¾ãã
表示çµæã¯ãã©ãããWindows_NTãã§åãã«ãªãã¾ããã*3
ãã¹ã2
ãã¹ã1ã®å ´åã¯ç°å¢å¤æ°OSã®å¤ã表示ãã¾ããããä»åº¦ã¯ã%OS%ãã¨ããæååã表示ãã¾ããç¹æ®æåã®%ãã¨ã¹ã±ã¼ãããã®ã§ãechoã®å¾ã¯ã^%OS^%ãã¨ãªãã¾ããå®è¡çµæã¯æ¬¡ã®ããã«ãªãã¾ãã
C:\>echo ^%OS^% %OS% C:\>echo ^%OS^% | more Windows_NT C:\>echo ^%OS^% > tmp & more < tmp %OS%
1çªç®ã¨3çªç®ã§ã¯ãæ³å®ã©ããã«ã%OS%ãã表示ããã¾ããããããã2çªç®ã®ãã¤ããçµç±ããã±ã¼ã¹ã§ã¯ããªããã%OS%ããå±éããã¦ããWindows_NTãã表示ããã¾ããã
ãã¹ã3
ä»åº¦ã¯ãã¤ããçµç±ããã±ã¼ã¹ã§ãã%OS%ãã¨è¡¨ç¤ºããããããããã«ç¹æ®æåãã¨ã¹ã±ã¼ããã¦ãechoã®å¾ãã^^^%OS^^^%ãã¨ãã¦ã¿ã¾ããå®è¡çµæã¯æ¬¡ã®ããã«ãªãã¾ãã
C:\>echo ^^^%OS^^^% ^%OS^% C:\>echo ^^^%OS^^^% | more %OS% C:\>echo ^^^%OS^^^% > tmp & more < tmp ^%OS^%
2çªç®ã®ãã¤ããçµç±ããã±ã¼ã¹ã§ã%OS%ãã表示ããã¾ãããããããå½ç¶ã®ãã¨ãªããã1çªç®ã¨3çªç®ã§ã¯ä½åãªã¨ã¹ã±ã¼ãæåãä»ãã¦ã^%OS^%ãã¨è¡¨ç¤ºããã¾ããã
ã¾ã¨ã
cmd.exeã§ãã¤ãã使ãã¨ããã¼ã¿ä¸ã®ã%ç°å¢å¤æ°%ããå±éããã¾ãã(é 延å±éãæå¹ãªå ´åã¯ãã!ç°å¢å¤æ°!ããå±éãããã¨æããã¾ãã) å¦ç対象ã®ãã¼ã¿ã«ã%ããã!ããå«ã¾ããå ´åã¯ã注æãå¿ è¦ã§ããå ´åã«ãã£ã¦ã¯ãä¸æãã¡ã¤ã«ã使ã£ãã»ããããããããã¾ããã
*1:Windows XP SP3ã§ç¢ºèªãã¾ããã
*2:ä¸æãã¡ã¤ã«ãæ®ãã®ã¯ãç¡è¦ãã¦èãã¾ãã
*3:å®éã«ã¯ããã¤ãçµç±ã®å ´åã¯æ¹è¡ã1ã¤å¤ãã®ã§ããã話ã®å¤§çã«é¢ä¿ããªãã®ã§ç¡è¦ãã¾ãã