WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Display Graphical Directory Tree in a Message


#DefineFunction GetSTDOUT(cmd)
	objShell = ObjectOpen("WScript.Shell")
	objWshScriptExec = objShell.Exec(cmd)
	objStdOut = objWshScriptExec.StdOut
	
	line=""
	While ! objStdOut.AtEndOfStream
	   strLine = objStdOut.ReadLine
		if line == ""  ;check if first line
	      line = strCat(strLine,@CR)
		else 
		   line = strCat(line,strLine,@CR)
 	   endif
	Endwhile
	
	ObjectClose(objStdOut)
	ObjectClose(objWshScriptExec)
	ObjectClose(objShell)
	
	Return line
#EndFunction


;Tree
;Graphically displays the directory structure of a path or of the disk in a drive.

DirChange(DirWindows(0))
cmd = 'cmd /c tree c:\windows /a'
data = GetSTDOUT(cmd)
Message(StrCat(cmd," - STDOUT"), data)
exit

Article ID:   W15970
File Created: 2004:03:30:15:42:06
Last Updated: 2004:03:30:15:42:06