Anyone good with batch files?

fly said:
Then why in the hell would I use Perl? :D

Well, it's great if you're administrating a *nix machine. I haven't messes with it too much, but one of the first useful scripts I ever wrote was in perl. It dynamically generated a webpage for some reason or another... something to do with sending messages to pagers.
 
fly said:
Then why in the hell would I use Perl? :D
Standard on anything *nix. Practical Extraction and Report Language... Like for parsing. There is nothing you cant do in perl, even if it is incredibly slow.
 
FlamingGlory said:
Standard on anything *nix. Practical Extraction and Report Language... Like for parsing. There is nothing you cant do in perl, even if it is incredibly slow.
Yeah, and its essentially useless on Windows.
 
fly said:
Yeah, and its essentially useless on Windows.
Well you werent specific on what you wanted done so:

Code:
Function Haha(patrn, str)
  Dim regEx, str1
  str1 = "C:\Documents and Settings\Administrator\Desktop\driverscript\Drivers~\110\a\driver.inf"
  Set regEx = New RegExp            
  regEx.Pattern = patrn  
  regEx.IgnoreCase = True
  Haha = regEx.Replace(str1, str)
End Function

MsgBox(Haha("\\110\\a", ""))

edit: this post in no way implies I know much about vbscript, but I am _that_ bored
 
Last edited:
In case anyone is interested:

Here's the cleaned up version of what seems to do what Fly was looking for. It started out as a script I found that would draw a directory tree. Now it finds .inf files. It can be changed easily enough to have broader uses.

Code:
set fso=CreateObject("Scripting.FileSystemObject")
'this is where you want to start looking from
listdir "C:\work\dev"

function listdir(folder)

set fold = fso.getfolder(folder)
set folcol = fold.subfolders
for each foo in folcol
	set flist = foo.files
	for each vfile in flist
	if right(vfile, 3) = "inf" then
		wscript.echo  vfile
		wscript.echo foo
		a_foo = split(foo, "~")
		wscript.echo a_foo(1)
	end if
        next
listdir (folder +"\"+foo.name)
next


end function