Jump to content

Is it possible to run .vbs scripts from cmdlines?


Recommended Posts


start /wait file.vbs 

that should work..

Not when you are paranoid about security!

For example, I run this command:

assoc .vbs=txtfile

So the VBscripts are not self-running anymore after that!

In that case, run it this way:

cscript //B "%your_path%\your_file.vbs" //NoLogo //T:600

Link to comment
Share on other sites

Thanks guys.

I'm working on a script, that will detected the computer model and install the appropiat drivers and some custom software.

The script is sorta working, having some problems with escape characters, when I try to add a string to the reg database. Does anybody know how to escape out " and \?

I tried \" and \\... didnt do the job.

Link to comment
Share on other sites

windows will install appropriate drivers..

then all u need 2 do.. is in a batch file.. say u are wanting 2 install ati control panel

IF EXIST "%Windir%\System32\atifile.exe" GOTO ATICP
GOTO END
:ATICP
start /wait %systemdrive%\drivers\ati\cp\file.exe /switch
GOTO END
:END

same code can be modified 2 work with autoit too :)

hope this is of some assistance

Link to comment
Share on other sites

windows will install appropriate drivers..

then all u need 2 do.. is in a batch file.. say u are wanting 2 install ati control panel

IF EXIST "%Windir%\System32\atifile.exe" GOTO ATICP
GOTO END
:ATICP
start /wait %systemdrive%\drivers\ati\cp\file.exe /switch
GOTO END
:END

same code can be modified 2 work with autoit too :)

hope this is of some assistance

I'm aware of that. My script do about the same as yours do. Instead of looking for specific files, I look at the computer model.

And yes, its the control panal thingies I need to install for the drivers. I also need to install some special programs depending on the computer (laptop/desktop and so on).

Link to comment
Share on other sites

sorry i cant help with the .vbs, im fairly new 2 it myself..

but i would try autoit or the above method as they are pretty much straight forward :)

regards

Link to comment
Share on other sites

assoc .vbs=txtfile

Theres paranoia there's taking it too far. Yes that'll break the association but couldn't you just not double click the things? VBS is a useful little scripting langauge, a great many of the IIS tools are vbs scripts, you won't be able to use any of the after that little alteration. You also break VBS for any unsuspecting users on the machine who have no idea what you did. As someone who supports some relatively complicated (in my opinion anyway) scripts used to install/uninstall an open source project this sort of thing causes me major headaches with id*** users.

Double quotes in vbs are "". By which i mean if you want a string to contain " you use "" , so a

"a quote ""quoted text"""

will be printed as

a quote "quoted text"

You'll soon get tired of couting up double quote characters. Sometimes its better to use

"a quote " & chr(32) & "quoted text" & chr(32)

for clarity, its a matter of personal preference.

Link to comment
Share on other sites

Thanks AMDTWraith. Dont I need to escape out \ ?

sfamonkey: Ill see what I can do. Might post my work log including my config files when I'm done with this RIS project. Got a few weird problems with some programs thou, that I'm currently trying to get going (link to another thread in the first post in this thread).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...