Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


.bat files

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,46915
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> .bat files
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 .bat files - 5/9/2007 8:48:55 PM   
  bohmig

 

Posts: 2
Score: 0
Joined: 5/9/2007
Status: offline
Hi,

I've written some .bat files.

now I want to use these in a vbscript, to query some of the results of the .bat files.

how do i call a .bat file from within the vbscript??

also, i know how to setup a .bat file to run at startup, can the same be down for a vbscript file?
 
 
Post #: 1
 
 RE: .bat files - 5/9/2007 9:59:26 PM   
  LANlazy

 

Posts: 82
Score: 0
Joined: 4/11/2007
Status: offline
set shell=createobject("wscript.shell")
shell.run "filename.bat"


Yes the same can be done for a vbscript


(in reply to bohmig)
 
 
Post #: 2
 
 RE: .bat files - 5/10/2007 12:34:10 AM   
  gdewrance


Posts: 587
Score: 3
Joined: 3/16/2006
Status: offline
quote:

also, i know how to setup a .bat file to run at startup, can the same be down for a vbscript file?


Check out http://www.computerperformance.co.uk/Logon/logon_script_assign.htm

(in reply to bohmig)
 
 
Post #: 3
 
 RE: .bat files - 5/10/2007 3:59:00 AM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
the shell can be used in two modes, exec = cmd or run = start>run
so it always depends what you are calling. i would use exec mode for a batch calling..
i think this example is a good one:



      

Notice that you can retrive the output of your batch same way that you do in cmd batch.bat >> log.log
is the line:objExecObject.StdOut.ReadLine()
this way you can generate a log or whatever you want.
cheers,

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to gdewrance)
 
 
Post #: 4
 
 RE: .bat files - 5/10/2007 2:04:37 PM   
  mcds99


Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
If the batch file runs...

cscript myvbscript.vbs it should run just fine.

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to 4scriptmoni)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> .bat files Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts