Page 1 of 1 1
Topic Options
#17518 - 2002-02-15 06:15 AM Please help me with a simple script;
Darvish Offline
Lurker

Registered: 2002-02-15
Posts: 2
Loc: East Hartford
Please excuse my ignorance but I’m very new to Kixtart and scripting. I’m trying to write a script for a mixed environment such as windows95, windows 98, windows 2000 and XP. For the first time the script is supposed to copy some files to users machines, put some icons on their desktops, set their home page in IE and open the IE automatically via the login, after the first time all the script has do is to open the IE after the login. I know I’m asking too much but I would truly appreciate it if someone would tell me how to do this. darvish671@yahoo.com
Top
#17519 - 2002-02-15 06:27 AM Re: Please help me with a simple script;
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well, a good place to start is with the manual. Have you downloaded the html help file from www.ScriptLogic.com?

Let's start with a few macros.
@DOS
@InWin
@ProductType

File copy is pretty basic stuff.

Icons on the desktop... well that could be a bit more work depending on OS. You could try the built-in functions or better yet check out the UDFs in our UDF Library.

Then for starting IE after the logon, check the UDF section or search for RunOnce.

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#17520 - 2002-02-16 12:30 AM Re: Please help me with a simple script;
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
if you are using version 4 of kix then this is pretty simple...

use select/case around @producttype to handle variations in OS (like where the desktop is)
for example:
select
case @producttype=“Windows 95” $desktop="c:\windows\desktop"
case @producttype=“Windows NT Workstation” $desktop="c:\winnt\profiles\@userid\desktop"
case @producttype=“Windows 2000 Professional” $desktop="C:\Documents and Settings\@userid\desktop"
endselect

now you can copy the shortcuts there or files or whatever.

copy "\\server\share\desktop_stuff\*.*" "$desktop"

It is a start...

[ 15 February 2002: Message edited by: Radimus ]

[ 15 February 2002: Message edited by: Radimus ]

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#17521 - 2002-02-17 03:16 AM Re: Please help me with a simple script;
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

The usage of registry values may reduce your script length and is more universal
for different windows versions.
Our example:

code:

;
; - calculate desktop location and copy shortcuts to your desktop -
;
$desktop=ReadValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Desktop")
IF (Substr($desktop,len($desktop),1) <> "\")
$desktop=$desktop+"\"
ENDIF
COPY "\\server\share\*.lnk" "$desktop" /H
;
; - set IE
;
IF WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main","Start Page","http://kixtart.org","REG_SZ") <> 0)
? "Warning KIX: error @error (@serror)"
ENDIF
;
; - start IE
;
$start_page=ReadValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main","Start Page")
RUN '%comspec% /c start $start_page '


greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


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

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.051 seconds in which 0.022 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