Darvish
(Lurker)
2002-02-15 06:15 AM
Please help me with a simple script;

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

Les
(KiX Master)
2002-02-15 06:27 AM
Re: Please help me with a simple script;

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.

Radimus
(KiX Supporter)
2002-02-16 12:30 AM
Re: Please help me with a simple script;

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 ]

MCA
(KiX Supporter)
2002-02-17 03:16 AM
Re: Please help me with a simple script;

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.