How to automate multi-programs processing in Win 2K Professional (like Batch for DOS)
Author |
Message |
Davi #1 / 11
|
 How to automate multi-programs processing in Win 2K Professional (like Batch for DOS)
I am looking for something in WIN2k which is equivalent to the batch (.BAT) in DOS. For example: I call a program, then interact with its dialog boxes, pushing the right buttons depending on the result of the run up to that point (like checking "If errorlevel..." in Batch for DOS, etc.), whether was done successfully, then I want to tell it to SaveAs <path\filename> and then conditionally run again (hopefully w/o the need to reinvoke it), etc. etc. I am pretty sure there is a good method on how to accomplish it. Is there a particular scripting language for Win2K (such as Batch for DOS, REXX for OS2, etc. or hopefully something even better), prefered an interpreter where there is no need to compile, or perhaps C++ is still the best way to go for now? Questions: 1. Am I even in the right newsgroup for that purpose? 2. As is the case with Batch, the scriptive language must be able to take parameters at invokation time. 3. Can someone point me to a good source of info about it, hopefully with some samples? 4. Is there a program generator application, where I can use it to "record" a manual set of operations into such a source script program (like recording a Macro in Office applications) as my skeleton/starting point, where I can then just modify it slightly according my needs? Many thanks, David
|
Sun, 07 Nov 2004 05:21:14 GMT |
|
 |
mK #2 / 11
|
 How to automate multi-programs processing in Win 2K Professional (like Batch for DOS)
Hi David. That is what the Microsoft Windows Script Host is all about - "something in WIN2k which is equivalent to the batch in DOS" and better. Its interpreted. You can write your scripts using notepad save it as .vbs or .js then run it. 1. You're not exactly on the best newsgroup for this question, but i dont think youre in a wrong one either. 2. Yes, you can access parameters using wshArguments object within your scripts. You can even create com objects (CreateObject()) or access existing ones (GetObject()) 3. http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?co... =28001169 might be a good place to start. 4. err... a program generator might be a little too ambitious... Hope this helps.
Quote: > I am looking for something in WIN2k which is equivalent to the batch (.BAT) > in DOS. > For example: I call a program, then interact with its dialog boxes, pushing > the right > buttons depending on the result of the run up to that point (like checking > "If errorlevel..." in Batch for DOS, etc.), whether was done successfully, > then I want > to tell it to SaveAs <path\filename> and then conditionally run again > (hopefully w/o > the need to reinvoke it), etc. etc. > I am pretty sure there is a good method on how to accomplish it. > Is there a particular scripting language for Win2K (such as Batch for DOS, > REXX for OS2, etc. or hopefully something even better), prefered an > interpreter > where there is no need to compile, or perhaps C++ is still the best way to > go for now? > Questions: > 1. Am I even in the right newsgroup for that purpose? > 2. As is the case with Batch, the scriptive language must be able to take > parameters at invokation time. > 3. Can someone point me to a good source of info about it, hopefully with > some samples? > 4. Is there a program generator application, where I can use it to "record" > a manual set of > operations into such a source script program (like recording a Macro in > Office applications) > as my skeleton/starting point, where I can then just modify it slightly > according my needs? > Many thanks, > David
|
Sun, 07 Nov 2004 08:22:37 GMT |
|
 |
#3 / 11
|
 How to automate multi-programs processing in Win 2K Professional (like Batch for DOS)
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
 |
Davi #4 / 11
|
 How to automate multi-programs processing in Win 2K Professional (like Batch for DOS)
(2) Can the parameters be provided at the command invokation line (under Start/Run)? David
Quote: > Hi David. > That is what the Microsoft Windows Script Host is all about - "something in > WIN2k which is equivalent to the batch in DOS" and better. Its > interpreted. You can write your scripts using notepad save it as .vbs or > .js then run it. > 1. You're not exactly on the best newsgroup for this question, but i dont > think youre in a wrong one either. > 2. Yes, you can access parameters using wshArguments object within your > scripts. You can even create com objects (CreateObject()) or access > existing ones (GetObject()) > 3.
http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?co... Quote: > =28001169 might be a good place to start. > 4. err... a program generator might be a little too ambitious... > Hope this helps.
> > I am looking for something in WIN2k which is equivalent to the batch > (.BAT) > > in DOS. > > For example: I call a program, then interact with its dialog boxes, > pushing > > the right > > buttons depending on the result of the run up to that point (like checking > > "If errorlevel..." in Batch for DOS, etc.), whether was done successfully, > > then I want > > to tell it to SaveAs <path\filename> and then conditionally run again > > (hopefully w/o > > the need to reinvoke it), etc. etc. > > I am pretty sure there is a good method on how to accomplish it. > > Is there a particular scripting language for Win2K (such as Batch for DOS, > > REXX for OS2, etc. or hopefully something even better), prefered an > > interpreter > > where there is no need to compile, or perhaps C++ is still the best way to > > go for now? > > Questions: > > 1. Am I even in the right newsgroup for that purpose? > > 2. As is the case with Batch, the scriptive language must be able to take > > parameters at invokation time. > > 3. Can someone point me to a good source of info about it, hopefully with > > some samples? > > 4. Is there a program generator application, where I can use it to > "record" > > a manual set of > > operations into such a source script program (like recording a Macro > in > > Office applications) > > as my skeleton/starting point, where I can then just modify it > slightly > > according my needs? > > Many thanks, > > David
|
Sun, 07 Nov 2004 10:10:05 GMT |
|
 |
mK #5 / 11
|
 How to automate multi-programs processing in Win 2K Professional (like Batch for DOS)
Yes, any way you pass arguments (thru start|run, command line, shortcut...), WshArguments should be able to fetch it. If you "pass" it, they will come. microsoft.public.scripting.hosting or microsoft.public.scripting.wsh may be better newsgroups.
Quote: > (2) Can the parameters be provided at the command invokation line (under > Start/Run)? > David
> > Hi David. > > That is what the Microsoft Windows Script Host is all about - "something > in > > WIN2k which is equivalent to the batch in DOS" and better. Its > > interpreted. You can write your scripts using notepad save it as .vbs or > > .js then run it. > > 1. You're not exactly on the best newsgroup for this question, but i dont > > think youre in a wrong one either. > > 2. Yes, you can access parameters using wshArguments object within your > > scripts. You can even create com objects (CreateObject()) or access > > existing ones (GetObject()) > > 3.
http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?co... Quote: > > =28001169 might be a good place to start. > > 4. err... a program generator might be a little too ambitious... > > Hope this helps.
> > > I am looking for something in WIN2k which is equivalent to the batch > > (.BAT) > > > in DOS. > > > For example: I call a program, then interact with its dialog boxes, > > pushing > > > the right > > > buttons depending on the result of the run up to that point (like > checking > > > "If errorlevel..." in Batch for DOS, etc.), whether was done > successfully, > > > then I want > > > to tell it to SaveAs <path\filename> and then conditionally run again > > > (hopefully w/o > > > the need to reinvoke it), etc. etc. > > > I am pretty sure there is a good method on how to accomplish it. > > > Is there a particular scripting language for Win2K (such as Batch for > DOS, > > > REXX for OS2, etc. or hopefully something even better), prefered an > > > interpreter > > > where there is no need to compile, or perhaps C++ is still the best way > to > > > go for now? > > > Questions: > > > 1. Am I even in the right newsgroup for that purpose? > > > 2. As is the case with Batch, the scriptive language must be able to > take > > > parameters at invokation time. > > > 3. Can someone point me to a good source of info about it, hopefully > with > > > some samples? > > > 4. Is there a program generator application, where I can use it to > > "record" > > > a manual set of > > > operations into such a source script program (like recording a > Macro > > in > > > Office applications) > > > as my skeleton/starting point, where I can then just modify it > > slightly > > > according my needs? > > > Many thanks, > > > David
|
Sun, 07 Nov 2004 10:26:55 GMT |
|
 |
#6 / 11
|
 How to automate multi-programs processing in Win 2K Professional (like Batch for DOS)
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
 |
Gregory Phillip #7 / 11
|
 How to automate multi-programs processing in Win 2K Professional (like Batch for DOS)
To get you started on Windows Script Host 5.6 (WSH) which is EXACTLY what you are asking for, here is a simple example. this is written with the [optional] XML wrapper that Microsoft and the rest of the world seems to love. Just copy it to a file with the extension "wsf" (windows script file) and it can be run by clicking on it or from a command box. There are actually two versions of the WSH host: wscript.exe and cscript.exe. Wscript gives you a GUI style scripting (msg boxes etc) while cscript.exe outputs to a command box (looks like DOS use to). You can use either VBScript or Jscript and even a few other scripting engines (perl etc). For documentation just go to Microsoft and download the stand alone help documentation file from: http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?co... <?xml version="1.0" encoding="windows-1252"?> <job id="1" xmlns="Windows Scripting Host"> <script language="JScript"> <![CDATA[ //-------------------- JScript ------------------------------------- var i; WScript.echo("Starting execution of the script: "+WScript.ScriptName); WScript.echo(typeof(i)," ",i); for (i = 0; i < WScript.Arguments.length; i++) { WScript.echo(WScript.Arguments(i)); Quote: }
WScript.echo(typeof(i)," ",i); WScript.echo("Finished execution of the script."); //------------------------------------------------------------------------ ]]> </script> </job> Quote:
>I am looking for something in WIN2k which is equivalent to the batch (.BAT) >in DOS. >For example: I call a program, then interact with its dialog boxes, pushing >the right >buttons depending on the result of the run up to that point (like checking >"If errorlevel..." in Batch for DOS, etc.), whether was done successfully, >then I want >to tell it to SaveAs <path\filename> and then conditionally run again >(hopefully w/o >the need to reinvoke it), etc. etc. >I am pretty sure there is a good method on how to accomplish it. >Is there a particular scripting language for Win2K (such as Batch for DOS, >REXX for OS2, etc. or hopefully something even better), prefered an >interpreter >where there is no need to compile, or perhaps C++ is still the best way to >go for now? >Questions: >1. Am I even in the right newsgroup for that purpose? >2. As is the case with Batch, the scriptive language must be able to take >parameters at invokation time. >3. Can someone point me to a good source of info about it, hopefully with >some samples? >4. Is there a program generator application, where I can use it to "record" >a manual set of > operations into such a source script program (like recording a Macro in >Office applications) > as my skeleton/starting point, where I can then just modify it slightly >according my needs? >Many thanks, >David
---
|
Sun, 07 Nov 2004 12:28:01 GMT |
|
 |
#8 / 11
|
 How to automate multi-programs processing in Win 2K Professional (like Batch for DOS)
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
 |
Davi #9 / 11
|
 How to automate multi-programs processing in Win 2K Professional (like Batch for DOS)
Quote: > To get you started on Windows Script Host 5.6 (WSH) which is > EXACTLY what you are asking for, here is a simple example. > this is written with the [optional] XML wrapper that Microsoft and > the rest of the world seems to love. Just copy it to a file with > the extension "wsf" (windows script file) and it can be run > by clicking on it or from a command box. There are actually > two versions of the WSH host: wscript.exe and cscript.exe. > Wscript gives you a GUI style scripting (msg boxes etc) while > cscript.exe outputs to a command box (looks like DOS use to). > You can use either vbScript or Jscript and even a few other > scripting engines (perl etc). > For documentation just go to Microsoft and download the stand > alone help documentation file from:
http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?co... =28001169 Quote: > <?xml version="1.0" encoding="windows-1252"?> > <job id="1" xmlns="Windows Scripting Host"> > <script language="JScript"> > <![CDATA[ //--------------------
JScript ------------------------------------- Quote: > var i; > WScript.echo("Starting execution of the script: "+WScript.ScriptName); > WScript.echo(typeof(i)," ",i); > for (i = 0; i < WScript.Arguments.length; i++) > { > WScript.echo(WScript.Arguments(i)); > } > WScript.echo(typeof(i)," ",i); > WScript.echo("Finished execution of the script.");
//------------------------------------------------------------------------ ] ]> Quote: > </script> > </job>
> >I am looking for something in WIN2k which is equivalent to the batch (.BAT) > >in DOS. > >For example: I call a program, then interact with its dialog boxes, pushing > >the right > >buttons depending on the result of the run up to that point (like checking > >"If errorlevel..." in Batch for DOS, etc.), whether was done successfully, > >then I want > >to tell it to SaveAs <path\filename> and then conditionally run again > >(hopefully w/o > >the need to reinvoke it), etc. etc. > >I am pretty sure there is a good method on how to accomplish it. > >Is there a particular scripting language for Win2K (such as Batch for DOS, > >REXX for OS2, etc. or hopefully something even better), prefered an > >interpreter > >where there is no need to compile, or perhaps C++ is still the best way to > >go for now? > >Questions: > >1. Am I even in the right newsgroup for that purpose? > >2. As is the case with Batch, the scriptive language must be able to take > >parameters at invokation time. > >3. Can someone point me to a good source of info about it, hopefully with > >some samples? > >4. Is there a program generator application, where I can use it to "record" > >a manual set of > > operations into such a source script program (like recording a Macro in > >Office applications) > > as my skeleton/starting point, where I can then just modify it slightly > >according my needs? > >Many thanks, > >David > ---
|
Sun, 07 Nov 2004 13:56:10 GMT |
|
 |
#10 / 11
|
 How to automate multi-programs processing in Win 2K Professional (like Batch for DOS)
|
Fri, 19 Jun 1992 00:00:00 GMT |
|
 |
Davi #11 / 11
|
 How to automate multi-programs processing in Win 2K Professional (like Batch for DOS)
Quote: > Yes, any way you pass arguments (thru start|run, command line, shortcut...), > WshArguments should be able to fetch it. If you "pass" it, they will come. > microsoft.public.scripting.hosting or microsoft.public.scripting.wsh may be > better newsgroups.
> > (2) Can the parameters be provided at the command invokation line (under > > Start/Run)? > > David
> > > Hi David. > > > That is what the Microsoft Windows Script Host is all about - "something > > in > > > WIN2k which is equivalent to the batch in DOS" and better. Its > > > interpreted. You can write your scripts using notepad save it as .vbs > or > > > .js then run it. > > > 1. You're not exactly on the best newsgroup for this question, but i > dont > > > think youre in a wrong one either. > > > 2. Yes, you can access parameters using wshArguments object within your > > > scripts. You can even create com objects (CreateObject()) or access > > > existing ones (GetObject()) > > > 3.
http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?co... Quote: > > > =28001169 might be a good place to start. > > > 4. err... a program generator might be a little too ambitious... > > > Hope this helps.
> > > > I am looking for something in WIN2k which is equivalent to the batch > > > (.BAT) > > > > in DOS. > > > > For example: I call a program, then interact with its dialog boxes, > > > pushing > > > > the right > > > > buttons depending on the result of the run up to that point (like > > checking > > > > "If errorlevel..." in Batch for DOS, etc.), whether was done > > successfully, > > > > then I want > > > > to tell it to SaveAs <path\filename> and then conditionally run again > > > > (hopefully w/o > > > > the need to reinvoke it), etc. etc. > > > > I am pretty sure there is a good method on how to accomplish it. > > > > Is there a particular scripting language for Win2K (such as Batch for > > DOS, > > > > REXX for OS2, etc. or hopefully something even better), prefered an > > > > interpreter > > > > where there is no need to compile, or perhaps C++ is still the best > way > > to > > > > go for now? > > > > Questions: > > > > 1. Am I even in the right newsgroup for that purpose? > > > > 2. As is the case with Batch, the scriptive language must be able to > > take > > > > parameters at invokation time. > > > > 3. Can someone point me to a good source of info about it, hopefully > > with > > > > some samples? > > > > 4. Is there a program generator application, where I can use it to > > > "record" > > > > a manual set of > > > > operations into such a source script program (like recording a > > Macro > > > in > > > > Office applications) > > > > as my skeleton/starting point, where I can then just modify it > > > slightly > > > > according my needs? > > > > Many thanks, > > > > David
|
Sun, 07 Nov 2004 14:00:08 GMT |
|
|
|