|
Thanks for the quick response! Here is my code: **************************************** ;BREAK OFF SetConsole ("Show")
$filename = "*.txt" ; text files with Domain, Group, and user info
$startdir="g:\Groups\" ; directory to start search
$tmpfile = "c:\groups.txt" ; temporary file for search results
$GroupProgam = $startdir + "usrtogrp.exe"
; write search results to temporary file.
CD "$startdir" SHELL "%comspec% /c dir /s /b $filename > $tmpfile"
; read results from temporary file. OPEN(1,$tmpfile,2) cls ? ? ? ? ? ? " Current Group Text Files" ? "_____________________________________________" ? ? $string = READLINE(1) WHILE @ERROR = 0
; split the result in path and filename. $path = "" $file = $string If $string = "" goto finish Else WHILE INSTR($file,"\") $path = $path + SUBSTR($file,1,INSTR($file,"\")) $file = SUBSTR($file,INSTR($file,"\")+1,LEN($file)) LOOP $filename = $file $length =len($filename) $length2 =($length -4) $filename2 =left($filename, $length2) ?$Filename2 ; This displays the names of the text files $string = READLINE(1) Endif
LOOP ? ? CLOSE(1) ? "_________________________________________________" ? ? "Enter the Group Text File You Want to Add: " gets $selecttextfile
$selecttextfile2 = $selecttextfile +".txt"
cls
$RunGrpProgram = "g:\groups\usrtogrp.exe " + $selecttextfile2 shell "%comspec% /c $RunGrpProgram"
goto finish
:finish Del $tmpfile exit ********************************
the results are shown in the dos window and as soon as the scripts finishes the results are gone.
|