4 kwi 2008

Wyświetlenia okna wyboru folderu

Dim WshShell
Dim objShell
Dim ssfDir
Dim objFolder
Dim sdDir
WScript.Echo("Wybierz katalog do wysylki")

ssfDir = 0
set objShell = CreateObject("Shell.Application")
 set objFolder = objShell.BrowseForFolder(0, "Wybierz katalog", 0, ssfDir)
  if (not objFolder is nothing) then
'   sDir = objFolder.Items().Item.Path
   Set sDir = objFolder.Items()
   sCont = sDir.Count
   Set sdDir = sDir.Item
   sdpDir = sdDir.Path
   WScript.Echo (sdpDir & sCont)
  end if
set objFolder = nothing
25 sty 2008

VBSCRIPT - Wyświetlenie zawartości katalogu jako MsgBox

VBSCRIPT - Wyświetlenie zawartości katalogu jako MsgBox

Dim wsh, oExec

Set wsh   =  CreateObject("WScript.Shell")
Set oExec = wsh.Exec("cmd /c " & "dir c:")
wynik     = oExec.StdOut.ReadAll

msgbox wynik