Vbscript doubt


R

Richard M.

Hi,

I have to create a script with vbscript to put clint
computers in 10 domains.
I have 10 domains in nt server 4.0 and the client
computers is windows 2000 professional.

The computers is going to have an unattended installation,
and the script must have to associate the branch offices
with a specific number that are given to domains.

We have three variables.

Domain
Number of the branch Office
Location

Can anyone give an idea or a sample to do this??

Thanks,
 
Ad

Advertisements

R

Richard M.

The script must get the data to a file with extension csv
or txt.
 
D

Dave

Hi,
heres a simple example of opening a text file (csv, ini, whatever) and
reading the file content.
You'd then need to parse the returned string using Split() for example. For
more info have a look at the Scripting Runtime library (scrrun.dll) in MSDN.

The following link shoould get you started,
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/sgworkingwithfiles.asp

hth,
Dave


'#######################
Public Function ReadFileContent(ByVal pFilePathStr)
Dim objFSO
On Error Resume Next
ReadFileContent = ""

Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.FileExists(pFilePathStr) Then
ReadFileContent = objFSO.OpenTextFile(pFilePathStr, 1).ReadAll()
End If

If Not Err.Number = 0 Then
ReadFileContent = ""
'Handle Error here
End If
End Function
'########################
 
P

Patrick J. LoPresti

If you are willing to learn a little Perl, you could use
<http://unattended.sourceforge.net/>. It includes a Perl module for
parsing .csv files. I use it for my own unattended installs to set
the host name and product key from a spreadsheet indexed by corporate
asset tag.

As I mentioned, the code is in Perl, but I would be happy to share it
with you. (Actually, most of it is already in the distribution.)

- Pat
 
R

Richard M.

I didn´t find it.

If you can tell me where is the link for that.
Thanks,
 
Ad

Advertisements

P

Patrick J. LoPresti

Go to <http://unattended.sourceforge.net/>. Follow the instructions
to download the distribution and get it working for a basic unattended
install.

The Perl module for parsing .csv files is in install\lib\csv.pl in the
distribution. It is also available here:

http://cvs.sourceforge.net/viewcvs.py/unattended/unattended/install/lib/csv.pl?rev=HEAD&view=auto

....but it is unlikely to be useful until you get the rest of the
system working.

Once you have the system working, I can give you the site\config.pl
file which I use to set the host name and product key from a
spreadsheet. (This runs as part of the process for generating
unattend.txt, before the unattended installation is launched.)

I admit it takes some work to get this set up, but once finished it is
very easy to do what you are asking.

- Pat
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top