MSFN Forum: Is it possible to run .vbs scripts from cmdlines? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Is it possible to run .vbs scripts from cmdlines? Rate Topic: -----

#1 User is offline   egil 

  • Newbie
  • Group: Members
  • Posts: 47
  • Joined: 23-November 03

Posted 30 July 2004 - 02:33 AM

Well topic says it all. Is it, and how?

On a second note, I'm having problems installing DirectX, IE6 and QuickTime from RunOnceEx on a Windows 2000 Pro., can anybody help with that (longer description of the problem)?


#2 User is offline   MCT 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 3,288
  • Joined: 19-May 04

Posted 30 July 2004 - 03:07 AM

u should be able 2, i think

start /wait file.vbs

that should work..
regards :)

#3 User is offline   AMDTWraith 

  • Newbie
  • Group: Members
  • Posts: 26
  • Joined: 04-June 04

Posted 30 July 2004 - 05:19 AM

Yes.

#4 User is offline   prathapml 

  • Follow the rules please :-)
  • Group: Patrons
  • Posts: 6,791
  • Joined: 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 30 July 2004 - 06:06 AM

MCT, on Jul 30 2004, 02:37 PM, said:

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


#5 User is offline   sfamonkey 

  • Junior
  • Pip
  • Group: Members
  • Posts: 77
  • Joined: 22-July 04

Posted 30 July 2004 - 07:08 AM

I just did
start /wait %sysdrive%/install/winamp/winamp.js


But using AutoIt is better when writting a making scripts if you need help on how to write the scripts with AutoIt let me know.

#6 User is offline   big_gie 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 617
  • Joined: 27-July 03

Posted 30 July 2004 - 07:13 AM

I call a .js script from cmdlines.txt like this:
wscript ..\Programmes\scripts\cmdlines.js

where cmdlines.txt is in <CD>\$OEM$\cmdlines.txt
cmdlines.js is in <CD>\Programmes\scripts\cmdlines.js

#7 User is offline   sfamonkey 

  • Junior
  • Pip
  • Group: Members
  • Posts: 77
  • Joined: 22-July 04

Posted 30 July 2004 - 08:34 AM

my mistake did read. My way is through a batch.

#8 User is offline   egil 

  • Newbie
  • Group: Members
  • Posts: 47
  • Joined: 23-November 03

Posted 30 July 2004 - 08:59 AM

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.

#9 User is offline   MCT 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 3,288
  • Joined: 19-May 04

Posted 30 July 2004 - 10:26 AM

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

#10 User is offline   egil 

  • Newbie
  • Group: Members
  • Posts: 47
  • Joined: 23-November 03

Posted 30 July 2004 - 10:44 AM

MCT, on Jul 30 2004, 05:26 PM, said:

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).

#11 User is offline   MCT 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 3,288
  • Joined: 19-May 04

Posted 30 July 2004 - 10:47 AM

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

#12 User is offline   sfamonkey 

  • Junior
  • Pip
  • Group: Members
  • Posts: 77
  • Joined: 22-July 04

Posted 30 July 2004 - 10:50 AM

hey when you get that script done will you post it. It seems very interesting.

#13 User is offline   AMDTWraith 

  • Newbie
  • Group: Members
  • Posts: 26
  • Joined: 04-June 04

Posted 30 July 2004 - 07:12 PM

Quote

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.

#14 User is offline   egil 

  • Newbie
  • Group: Members
  • Posts: 47
  • Joined: 23-November 03

Posted 31 July 2004 - 02:36 AM

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).

#15 User is offline   fillalph 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 324
  • Joined: 29-July 03

Posted 31 July 2004 - 03:31 AM

@egil: take a look at this thread http://www.msfn.org/board/index.php?showtopic=21316&st. I did something similiar to what you are trying to do.

]Bonkers[

#16 User is offline   AMDTWraith 

  • Newbie
  • Group: Members
  • Posts: 26
  • Joined: 04-June 04

Posted 31 July 2004 - 05:02 AM

Quote

Thanks AMDTWraith. Dont I need to escape out \ ?

Why? read the language specification, \ isn't important to vbs, it doesn't use c style escapes. Perhaps you'd be better of writing it in javascript if you're used to that.

#17 User is offline   egil 

  • Newbie
  • Group: Members
  • Posts: 47
  • Joined: 23-November 03

Posted 31 July 2004 - 05:13 AM

I know java, but I was just asking since I googled about and saw somewhere that I was suppose to escape out \ as well. Might just have been me looking at a page for javascripts at a late night.

Thanks again

PS. Besides the reference page on msdn, can you recommend any pages about vbs' thats good to keep in reach for reference and such.

#18 User is offline   AMDTWraith 

  • Newbie
  • Group: Members
  • Posts: 26
  • Joined: 04-June 04

Posted 31 July 2004 - 05:53 AM

The vbscript and wscript msdn reference are all i use. They even have a good regex reference in there.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy