ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¦p¦ó°±¤î«Ì¹õ°{°Ê

¦p¦ó°±¤î«Ì¹õ°{°Ê

­P¤j¤j­Ì,

½Ð°Ý¹á¤U¥N½X­n¦p¦ó¤~¥i¥H°±¤î«Ì¹õ°{°Ê.
  1. Sub zz()
  2. Debug.Print CreateObject("WScript.Shell").exec("%comspec% /c " & """VOL c:""").StdOut.ReadAll
  3. End Sub
½Æ»s¥N½X

¦^´_ 1# ikboy


    ¤£²M·¡±zªº¥N½Xªº¥Î³~
¦ý¤@¯ë¨Ó»¡EXCEL°±¤î¿Ã¹õÂà°Ê³£¬O¨Ï¥Î
Application.ScreenUpdating = False'°±¤î
Application.ScreenUpdating = True'«ì´_
PKKO

TOP

¦hÁÂPKKO, ³o¤èªk¤£¾A¥Î©ó¦¹.
¦¹¥N½X°N¬OÀH«K¤Þ¥Î¤@¨ÇDOSªº¬d¸ß, §â¶Ç¦^ªº DEBUG PRINT ¥X¨Ó¡C

TOP

¦^´_ 1# ikboy
¦pªG¬O­n¨ú±oºÏºÐ¼ÐÅÒ¦WºÙ©MºÏºÐ§Ç¸¹¡A¥i¸Õ¸Õ¤£¦P¤èªk
  1. Sub Test()
  2.     Dim oFS As Object, oDrive As Object
  3.     Set oFS = CreateObject("Scripting.FileSystemObject")
  4.     Set oDrive = oFS.drives("D")
  5.    
  6.     Debug.Print "¼ÐÅÒ: " & oDrive.VolumeName
  7.     Debug.Print "§Ç¸¹: " & Hex(oDrive.SerialNumber)
  8. End Sub
½Æ»s¥N½X
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

stillfish00§A¦n,

·Q¨Ó¬O§ÚÁ|¨Ò°ÝÃD¤£¦n, ¥H dir ¨Ó°µ¨Ò¤l, fso ¬O«Ü¦nªº¸Ñ¨M«Ì¹õ°{°Ê, ¦ý§Ú¬O·Q©óshell ¤¤¥ÎDOS ¬d¸ß, ¦Ó¯à±±¨î«Ì¹õ°{°Ê, ¨Ò¦p­n¬d¸ß xcop /?, fso «K¤£¯à°µ¨ì, ¥H¤U¥N½X«K¯à°µ¨ì, ¦ý¦³«Ì¹õ°{°Ê¡C

Sub zz()
Debug.Print CreateObject("WScript.Shell").exec("%comspec% /c xcopy /?").StdOut.ReadAll
End Sub

TOP

¥»©«³Ì«á¥Ñ jackyq ©ó 2016-7-19 23:43 ½s¿è

¦^´_ 5# ikboy

exec ¦n¹³¤£¯àÁôÂà window

¥i¥H¥Î    CreateObject("WScript.Shell").Run   cmd , 0   , true

https://msdn.microsoft.com/en-us/library/d5fk67ky%28v=vs.84%29.aspx

¿é¥Xµ²ªG¥i¥H¥ÎºÞ¹D¼g¨ì txt ÀÉ

¦AŪ¥X¨Ó

TOP

jackyq,
........,0,1 > .txt ¬O¥i¥H, §Ú¤@¦V³£¬O³o¼Ë°µ, ¦ý§Ú´N¬O·Q¤@¦¸¹L©ñ¤J¼Æ²Õ, §Ú´¿°t¦X¹L clip «ü¥O©ñ¤J°Å¶Kï, ¤w¦¨¥\, ¦ý.........stdout ¦ü¥G§ó§Ö±¶¤Î²³æ¡C ¥Ø«e´N¬O¦p¦ó¥t CreateObject("WScript.Shell").Exec ¦p CreateObject("WScript.Shell").Run ¯ë,°µ¨ì¦³µ¡¤fÁô½ª¥\¯à¡C

TOP

        ÀR«ä¦Û¦b : ¦³®É·í«äµL®É­W¡A¦n¤Ñ­n¿n«B¨Ó³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD