Jump to content

VBS instead of CMD for RunOnceEx?


Recommended Posts

I am curious why all the examples I have seen use a CMD file for setting up RunonceEx stuff? I am thinking about building an install CD that builds RunOnceEx stuff based on machine name (wks_01-20 are admin machines, wks_21-XX are graphics machines with different apps), and I would rather handle the conditional stuff in VBScript, assuming I could even do it in a CMD.

So, is there some reason why WSH isn't being used here?

Best,

Gordon

Link to comment
Share on other sites


Because you build your ROE at T-12 and I am not sure (maybe you could test it?) if WSH is available at the moment. Building stuff based on computer name isnt hard from cmd - just use pipe and find command.

For example:

echo %computername% | find /i "wks_01" && If %errorlevel% EQU 0 Call wks_adm.bat

Link to comment
Share on other sites

My cmdlines.txt and all of my RunOnceEx stuff is done in VBscript. I'm actually getting it all together in preparation to post here. As far as cmdlines.txt you need to be aware the you can only use cscript, not wscript. Also WMI is not available at that point either.

Link to comment
Share on other sites

As far as cmdlines.txt you need to be aware the you can only use cscript, not wscript.  Also WMI is not available at that point either.

So it would seem that I can use the language I am familiar with, but I am still going to see a bit of a command line dialog. Oh well, not a big deal really.

Thanks,

Gordon

Link to comment
Share on other sites

For what's it's worth, I wanted to use some vbs scripts for my application installs using the runonce. cmd method. We have our applications (MSIs) using transform files that we code through a vbs file. Could not get it to work, my guess is that the windows script handler is not available, although we haven't tried copying this to say... the system32 folder and executing from there.

Experience tells me that the vbs currently fails using this method at the T-12 mark, so we went back to batch files instead (for the time being).

If anyone has had any luck, I would be interested as well.

Link to comment
Share on other sites

It's a little earlier than what I was hoping for, but I'll try to get all my stuff together and post with 24 hours. I just wanted to make sure everything was properly documented first. But the short answer is that yes you can run a vbscript from cmdlines.txt.

Link to comment
Share on other sites

who said that WMI is not available.? the reason why you don't a lot of scripts here because people don't know how to do it

if you have a winxp installed in your machine, it is available. you simply have to install WMI from MS for other machines.

i know WMI and all MS scripts. i will see what i can do.

:)

Link to comment
Share on other sites

VBS works at T-12 ...

My cmdlines.txt file :

[COMMANDS]

"WScript cmdlines.vbs"

and cmdlines.vbs is the script :

Dim VarShell, VarIE

Set VarShell = CreateObject("WScript.Shell")

...

...

Like cmdlines.txt, cmdlines.vbs is located in $OEM$

Link to comment
Share on other sites

i have a problem running WMI script using CIM_DATAFILE class on my winxp SP2 computer.

i wonder if you have the same problem. If Anybody here knows what CIM_DATAFILE class in WMI is, can you run a small script which contains this class to see if you have any problem.?

thank you

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