Copy file to local drive - or best way to execute a VB script

(imported topic written by SystemAdmin)

I would like to create a task to either copy a file (a VB script file) to the local drive of the client, or have a task to execute a VB script. Right now I’m using appendfile to create a temp file then executing it and that’s rather a pain. Is that the best/only way to execute a VB script? If so how can I just take the file from a network share and copy it to the local C drive then execute it?

Basically I want to copy a VB script file to the C drive, then run = waithidden cmd.exe /c cscript c:\copiedVBscript.vbs

Thanks for your time…

Brian

(imported comment written by wnolan91)

Here is an example… assuming you have a place to Host your code…

download http://{internal website}/downloads/SMS/smssiteportswitch.vbs

continue if {…SHA1 information…}

wait “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” “{pathname of system folder & “\cscript.exe”}” “__download\smssiteportswitch.vbs”

(imported comment written by SystemAdmin)

ahh, Thanks, didn’t think of hosting it on a web server!!

(imported comment written by jessewk)

Note that your BES server is a web server. You can just cache the files somewhere in wwwrootbes folder on the server to make them accessible over http. It would look something like this:

download http://:52311/yourfile.vbs

(imported comment written by SystemAdmin)

I put the file on a web server (not a bigifx server) and created a custom task. If I run the task the status just sits at pending downloads.

Here is the action script:

prefetch myVBfile.vbs sha1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx size:46756 http://webserver.com/myVBfile.vbs

wait "{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”} "{pathname of system folder & “\cscript.exe”} "__download\myVBfile.vbs

Not really sure what I’m doing wrong, any advice is appreciated. Am I missing some permissions or something on my web server I wonder?

(imported comment written by BenKus)

If it stays at “pending download” and keeps retrying the download, it usually means that the url OR the sha1 OR the size is wrong.

Try to download from the URL and then check the size and sha1 of the resulting file.

Ben

(imported comment written by SystemAdmin)

I used the Windows Software Distribution Wizard to copy the file to the server and create the task. It creates the sha1 etc for you and now that task works great!

Thanks