Page 1 of 1 1
Topic Options
#42769 - 2003-07-11 03:38 PM Need help to streamline my script
LVF Offline
Fresh Scripter

Registered: 2002-10-25
Posts: 10
I need to determine the CDROM drive and this is what i've got sofar. The problem is that if the hosts file is copy/backuped the script wants to copy it from every drive. Any suggestions are welcome.

variables:
$host2k = "%systemroot%\system32\drivers\etc"

Script

$Array=d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z
For Each $element In $Array
Shell 'cmd /c copy "$host2k\hosts" "$host2k\hosts.org"' ; backup original hosts file
Shell 'cmd /c copy "$element:\hosts" "$host2k\hosts"' ; implement new hosts file
Next
GoTo end

Top
#42770 - 2003-07-11 03:42 PM Re: Need help to streamline my script
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Would you mind providing us the 'big picture'? I don't see anything that relates to a CD-ROM drive.

Additionally, please take a look at the UDF Forum as a UDF for determining drives types, like CD-ROM drives, has laready been posted.

Also, please use the build-in COPY command instead of SHELLing out.

Finally, why do you copy the files to all driveletters?

And please do not use variables inside strings and refrain from using GOTOs.
_________________________
There are two types of vessels, submarines and targets.

Top
#42771 - 2003-07-11 03:51 PM Re: Need help to streamline my script
LVF Offline
Fresh Scripter

Registered: 2002-10-25
Posts: 10
You're absolutly wright! I try to make a script which installs IE6 for the home computer of my users and it's must copy a new hosts file for access to the company network. The problem is that not everyone had the D-drive as his CD-ROM drive. j.meijer@lvf.nl
Top
#42772 - 2003-07-11 03:55 PM Re: Need help to streamline my script
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well, if you are running the script from the CD drive, @ScriptDir would tell you what it is.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#42773 - 2003-07-11 03:58 PM Re: Need help to streamline my script
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Okay, so let me rephrase wht you try to do.

You provide users with a CD-ROM containing an IE6 install (hopefully prepared with IEAK for completely silent install!). After the IE6 install, you also want to copy over the HOSTS file from the same CD-ROM.

Q: Where is the script being run from?

My solution: KiXtart and the script are included in that CD-ROM. User clicks on an INSTALLME.BAT file which in turn starts the KiXtart script. Thus, the @SCRIPTDIR macro includes the dirveletter of the CD-rOM dirve as it is being started from there. Then LEFT(@SCRIPTDIR,1) will give you the drive letter.

Alternatively, see the following UDFs: WshEnumDrives() - Enumerate drives on your local machine and DriveEnum() - return a list of specific, connected drive types

Finally, there might be a way to include the HOSTS file update into the IE install though the IEAK. I highly recommend to use IEAK for the deployment, giving users choices is a risk!
_________________________
There are two types of vessels, submarines and targets.

Top
#42774 - 2003-07-11 04:14 PM Re: Need help to streamline my script
LVF Offline
Fresh Scripter

Registered: 2002-10-25
Posts: 10
Indeed @SCRIPTDIR is what i need.
It's an autorun cd which calls a kix script.
The user see a menu to choose his OS and the script will backup/copies the hosts file, next it wil determine which version of IE is used. If it's below version 6 or 128-bits encryption, it's installing IE6 or a patch to 128-bits encryption (W95).

Thanks a lot also for mention IEAK.

Greetz

Top
#42775 - 2003-07-11 04:17 PM Re: Need help to streamline my script
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Automate OS detection with @PRODUCTTYPE or use the OSID() UDF.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
3 registered (fergieman101, Glenn Barnas, Mart) and 183 anonymous users online.
Newest Members
emnipetro, Hirze, thequeen, ameliaryan, shalomsalami
17641 Registered Users

Generated in 0.03 seconds in which 0.01 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org