HighTechTalks DotNet Forums  

Looking for good scripting language

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss Looking for good scripting language in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
sudhakarg79
 
Posts: n/a

Default Looking for good scripting language - 02-28-2005 , 09:57 AM








Hello,

I am newbie to Windows. (Advanced Linux user). For Windows, I want to
write a script that searchs for all executables in computer. Then, I want to
run another program ("dumpbin") on each of the result. Finally I want to
collate the results.

Can someone tell me what is a good language to do this? I looked at VBScript
and Windows Script Host. TO me, it looks like these languages do not support
directory traversal.

I can use PERL. But then, I do no want to install perl. My program will have
to run on some hosts which may not have perl. So I want to make miminalistic
assumptions.

thanks,
Sudhakar.


Reply With Quote
  #2  
Old   
Steve Seguis [MVP]
 
Posts: n/a

Default Re: Looking for good scripting language - 02-28-2005 , 03:44 PM






Hi Sudhakar,

The easiest way to do what you're asking is to use Windows shell scripting
(what some people call batch files). Anyhow, to do something like this, you
could run something like this from the command prompt

for /f "tokens=*" %i in ('dir /s /b /a-d c:\*.exe') do call dumpbin.exe "%i"

It could take a while to run since it obviously has to traverse the
directory tree. You may also want to check out the forfiles command that's
also built into the windows command shell.

--
Steve Seguis - MCSE, MVP Windows Server, SCJP
SCRIPTMATION, INC.
Automating the Enterprise
http://www.scriptmation.com


"sudhakarg79" <sudhakarg79 (AT) discussions (DOT) microsoft.com> wrote

Quote:

Hello,

I am newbie to Windows. (Advanced Linux user). For Windows, I want to
write a script that searchs for all executables in computer. Then, I want
to
run another program ("dumpbin") on each of the result. Finally I want to
collate the results.

Can someone tell me what is a good language to do this? I looked at
VBScript
and Windows Script Host. TO me, it looks like these languages do not
support
directory traversal.

I can use PERL. But then, I do no want to install perl. My program will
have
to run on some hosts which may not have perl. So I want to make
miminalistic
assumptions.

thanks,
Sudhakar.




Reply With Quote
  #3  
Old   
bruce barker
 
Posts: n/a

Default Re: Looking for good scripting language - 02-28-2005 , 03:55 PM



wsh is what your want.you can use vbscript or javascript (my choice).
instead of being built in the language, you use com objects (see FileSystem
Object for directory) to act with the o/s. more complex stuff is done with
the wmi objects.

see

http://msdn.microsoft.com/library/de...scriptinga.asp


-- bruce (sqlwork.com)




"sudhakarg79" <sudhakarg79 (AT) discussions (DOT) microsoft.com> wrote

Quote:

Hello,

I am newbie to Windows. (Advanced Linux user). For Windows, I want to
write a script that searchs for all executables in computer. Then, I want
to
run another program ("dumpbin") on each of the result. Finally I want to
collate the results.

Can someone tell me what is a good language to do this? I looked at
VBScript
and Windows Script Host. TO me, it looks like these languages do not
support
directory traversal.

I can use PERL. But then, I do no want to install perl. My program will
have
to run on some hosts which may not have perl. So I want to make
miminalistic
assumptions.

thanks,
Sudhakar.




Reply With Quote
  #4  
Old   
Steve Seguis [MVP]
 
Posts: n/a

Default Re: Looking for good scripting language - 02-28-2005 , 04:56 PM



Also, since you are an advanced linux user, you may be interested to know
that in the next version of Windows, the windows shell script will be
modified to what they call "MONAD" and is a perl-like syntax and is very
powerful. For now, I too would highly recommend WSH due to its sheer power.

--
Steve Seguis - MCSE, MVP Windows Server, SCJP
SCRIPTMATION, INC.
Automating the Enterprise
http://www.scriptmation.com


"sudhakarg79" <sudhakarg79 (AT) discussions (DOT) microsoft.com> wrote

Quote:

Hello,

I am newbie to Windows. (Advanced Linux user). For Windows, I want to
write a script that searchs for all executables in computer. Then, I want
to
run another program ("dumpbin") on each of the result. Finally I want to
collate the results.

Can someone tell me what is a good language to do this? I looked at
VBScript
and Windows Script Host. TO me, it looks like these languages do not
support
directory traversal.

I can use PERL. But then, I do no want to install perl. My program will
have
to run on some hosts which may not have perl. So I want to make
miminalistic
assumptions.

thanks,
Sudhakar.




Reply With Quote
  #5  
Old   
sudhakarg79
 
Posts: n/a

Default Re: Looking for good scripting language - 02-28-2005 , 05:19 PM





thanks Steve and Bruce. Please read on.

"Steve Seguis [MVP]" wrote:

Quote:
Hi Sudhakar,

The easiest way to do what you're asking is to use Windows shell scripting
(what some people call batch files). Anyhow, to do something like this, you
could run something like this from the command prompt

for /f "tokens=*" %i in ('dir /s /b /a-d c:\*.exe') do call dumpbin.exe "%i"
That is a good solution. But I am trying to see if there is a more powerful
engine. The thing is "for" only allows me to call one program. Now, I want to
run run dumpbin on each file and use the output for further processing.
Something like:

for i in *; do
cmd1
cmd2
..
done

I could techincally hack it up using some additonal batch files, but then
it is easier if I use a more powerful shell.


forfiles: I typed in "forfiles" in "cmd". The shell does not understand
the command.

Bruce, I went through the documentation you mnetioned the whole day
yesterday. I always kept gettig lost. :-) Can you show me how to write this
simple program in VBscript or Javascript? or WMI. is it that all Winodws
machines understand WMI?

thanks guys,
Sudhakar



Quote:
It could take a while to run since it obviously has to traverse the
directory tree. You may also want to check out the forfiles command that's
also built into the windows command shell.

--
Steve Seguis - MCSE, MVP Windows Server, SCJP
SCRIPTMATION, INC.
Automating the Enterprise
http://www.scriptmation.com


"sudhakarg79" <sudhakarg79 (AT) discussions (DOT) microsoft.com> wrote in message
news:FF21891F-338A-4E7B-9064-E84C86725806 (AT) microsoft (DOT) com...


Hello,

I am newbie to Windows. (Advanced Linux user). For Windows, I want to
write a script that searchs for all executables in computer. Then, I want
to
run another program ("dumpbin") on each of the result. Finally I want to
collate the results.

Can someone tell me what is a good language to do this? I looked at
VBScript
and Windows Script Host. TO me, it looks like these languages do not
support
directory traversal.

I can use PERL. But then, I do no want to install perl. My program will
have
to run on some hosts which may not have perl. So I want to make
miminalistic
assumptions.

thanks,
Sudhakar.





Reply With Quote
  #6  
Old   
AT
 
Posts: n/a

Default Re: Looking for good scripting language - 03-04-2005 , 01:40 PM



Anything you can do manually in Windows, you can automate with
AutoIt...

http://www.autoitscript.com/autoit3/

also, AutoIt is a full blown script engine. Supports DLL calls and has
built in file system traversal...

Larry


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.