WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
How about a VBS plugin (like BAT plugin) (Read 3886 times)
koalit
YaBB Newbies
*
Offline



Posts: 11
How about a VBS plugin (like BAT plugin)
Feb 10th, 2006 at 10:38am
 
In a "mini-workflow" I've set up using WD, I am calling alot of .VBS.

Could be possible to call .VBS directly instead of having to use a .BAT file to call the .VBS

Thanks for a GREAT product!

Cheers,
Mark
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: How about a VBS plugin (like BAT plugin)
Reply #1 - Feb 10th, 2006 at 12:28pm
 
That would be a plugin that does the same thing as the .bat file plugin, I guess? I'll think about it (but don't hold your breath).

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: How about a VBS plugin (like BAT plugin)
Reply #2 - Feb 10th, 2006 at 1:04pm
 
did you hold your breath  Cheesy
Try this:
Code:
GOTO :StartOfBat
; settings
;
; the following lines (all that start with a $ sign) are parsed by
; the GUI. The values you enter are stored in the *.config file
; in use for the task.
;
;NAME=Automatically run a VBS script

;
$SET CSCRIPT=exfile;CScript.exe;Please locate cscript.exe inside your "Program Files" directory
$SET OPTIONS=text;//B //NoLogo;Options to pass to cscript
$SET VBS_FILE=exfile;*.vbs;The VBS file you want to start
$$$

:StartOfBat

"%CSCRIPT%" "%VBS_FILE%" %OPTIONS%

 


Save the above as
C:\Program Files\watchDirectory\plugins\wdopAutoRunBat\templates\AutoRunVBS.template

Now, when you create a new task inside the control center, you have a new option to run a VBS.
I don't know/understand VBS, but I came up with the following script:
Code:
Wscript.Echo "Hello, world!"
Dim os
Set os = CreateObject("Wscript.Shell")
Wscript.Echo os.ExpandEnvironmentStrings("%WD_REASON%: %WD_FILE%")
 


And that seems to work fine, it prints the variables WD_REASON (why is the script called - FILENEW, FILECHNG etcetera) and WD_FILE (the file that caused the event). To see all %VARIABLES% you can use inside your script, see http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBatEnv.html

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: How about a VBS plugin (like BAT plugin)
Reply #3 - Feb 22nd, 2006 at 5:58pm
 
See this topic for the VBS plugin.

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Page Index Toggle Pages: 1