Page 1 of 2 12>
Topic Options
#45358 - 2003-09-09 03:05 PM @userid on win98 & XP
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
[Moderator (Sealeopard): Moved topic from 'Scripts' to 'Starters' forum due to lack of script in body]

hi

following the recent topic by skillz about the @userid, we are finding the same it works for some users, some machines and not others.

a normal user logs on a machine and it does not map their home folder a diffrent user logs on the same machine and it works fine with windows 98se and XP

any ideas

Thanks

Paul

[ 17. September 2003, 19:24: Message edited by: sealeopard ]

Top
#45359 - 2003-09-09 03:17 PM Re: @userid on win98 & XP
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Have you verified the account properites are correctly set for each user?

Have you verified that the user share actually exists and permissions on the share and underlying directory are correct?

Have you used @error and @serror to determine the reason for the failure?

Have you printed out the USE command text to see if it is formatted correctly?

[ 09. September 2003, 15:18: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#45360 - 2003-09-09 03:32 PM Re: @userid on win98 & XP
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
I have checked the various setting and all are correct

the same user that does not work on one machine can log on another fine

where do i put the @error and @serror commands

Paul

Top
#45361 - 2003-09-09 03:34 PM Re: @userid on win98 & XP
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
could you post the lines of your logonscript that relate to mapping?
_________________________
!

download KiXnet

Top
#45362 - 2003-09-09 03:39 PM Re: @userid on win98 & XP
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
;**
;** Connect Home Drive
;**
Function ConnectHomeDrive()
;******************************
; Home DriveShares
;******************************
Progress( "Connecting n:")

DbgMessage("Info","home folder - n: = " + @userid)

Use n: /delete/persistent

Use n: "\\$lserver\@userid"+"$"
If @ERROR = 1
DBGMessage ("HOMESHR","No Home Share available " + $lserver)
Else
DbgMessage ("Info","Home Share Connected " + @userid)

Return

EndIf
EndFunction

Top
#45363 - 2003-09-09 03:50 PM Re: @userid on win98 & XP
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what is $lserver?
if it's logonserver, does your users have homedrives on all logonservers?
_________________________
!

download KiXnet

Top
#45364 - 2003-09-09 03:55 PM Re: @userid on win98 & XP
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
yes lserver$ is the main 2K server,

all users have home drive, shared with the $ and permissions set for admin accounts and the user

tried using the server name and the ip address in the variable line above, made no diffrence

Top
#45365 - 2003-09-09 03:56 PM Re: @userid on win98 & XP
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Add a space between "/delete" and "/persistent".

Use the code below to return the connection failure and reason.


Use n: /delete /persistent

Use n: "\\" + $lserver + "\" @userid + "$$"

? "\\" + $lserver + "\" @userid + "$$"
If @ERROR <> 0
? "Error: @error @Serror"
endif


[ 09. September 2003, 15:59: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#45366 - 2003-09-09 04:15 PM Re: @userid on win98 & XP
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
thanks for the script

that is reporting "error 67 the network name cannot be found"

the folder is on the server and shared, i can map it from the run command on my machine ok

thanks

Top
#45367 - 2003-09-09 05:09 PM Re: @userid on win98 & XP
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
just to add problems

I have just mapped the home drive through the login script that runs kix and it maps fine

Any idea why kix's is not working

Thanks

Top
#45368 - 2003-09-09 05:10 PM Re: @userid on win98 & XP
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
What path was printed prior to the error? Is it a valid path or do you have four "\" before the server name or some other error that invalidates the USE statment?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#45369 - 2003-09-09 05:11 PM Re: @userid on win98 & XP
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
What does this mean? [Confused]
quote:
I have just mapped the home drive through the login script that runs kix and it maps fine

Any idea why kix's is not working

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#45370 - 2003-09-09 05:19 PM Re: @userid on win98 & XP
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
Howard

it was displaying just the username and the $ not the server name

I am running a basic script to install kix then start it, from the netlogon folder on the server. When i use the kix script to map the home drive it is random when it works, i have just addred the home drive line to the basic script using the net use command and that seems to be working

Thanks

Top
#45371 - 2003-09-09 05:23 PM Re: @userid on win98 & XP
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Well then you have a problem with the variable $lserver because it is obviously not defined in your script. That would be a valid reason to get error 67.

Please post all of your code so that we can see where the $lserver vaialbe is defined.

[ 09. September 2003, 17:24: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#45372 - 2003-09-09 05:35 PM Re: @userid on win98 & XP
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
hi

I am getting a error message from the board saying

"Sorry, we do not permit this HTML tag: Parenthesis in HTML tag" how do i send the code ???

Top
#45373 - 2003-09-09 05:38 PM Re: @userid on win98 & XP
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Use the CODE tags button below the edit window.

Please read: http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=1;t=005181#000000
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#45374 - 2003-09-09 05:41 PM Re: @userid on win98 & XP
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
thanks

code:
;;;;;;;adding debug menu for admin or support accounts ;;;;;;;;;;
;
if ingroup ("main admin grp") or ingroup ("support accounts");
$debug=1;
else ;
$debug=0;
endif;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


$TRUE = 1
$FALSE = 0
If $Debug=1
$DebugFlag = 1
Else
$DebugFlag = 0
EndIf
$DebugLevel = "Info"

;========================================================
;
; sending Email to admin account
;
$AdminEmail = "";
$MailServer = "";
;
;========================================================


;========================================================
;
; main server name
;
;$Lserver = "server-ip-address";
$LServer = "server-name"
;
;=======================================================

;========================================================
;
; File locations
;
$LoggingLocation="\\server-name\log$";
; log location
;


$FileLocation="\\server-name\news$"


; news file
;========================================================



Break Off

;Default Settings
$os=""
$os_type=""
$os_service_pack=""
$progressstep=3
$sleeptime=0
$numerrors=0
Global $time

Global $UpdateSoftware[0]
$Updates=0
$RunUpdates=$False

$tmpdir=ExpandEnvironmentVars("%tmp%")
$systemdrive=ExpandEnvironmentVars("%systemdrive%")
$windir=ExpandEnvironmentVars("%windir%")
$comspec=ExpandEnvironmentVars("%comspec%")


If Exist($systemdrive + "/program files/utils/kixtart") or
$KixDir=$systemdrive + "/program files/utils/kixtart"
Else
$KixDir=@LDrive
$KixDir="."
EndIf

Global $DebugMessages[0]
$NumMessages=0
$DebugMessages[$NumMessages]="-BEGIN--------------------------"

;================================================================
;
;
; Main Application
;
; Draw Form
DrawForms();
;
; Get OperatingSystemInformation Selects operating system
OperatingSystem() ;
$OSBox.Text=SubStr($os,1,22);

;
; Show News
ShowNews(); load news.txt file from
; Syncing Time
SyncTime();
;
;
; Connecting Drives
ConnectDrives();
;
;
; Install Printers
Installprinters()
;
;
; Set machine to stanard Settings
ExtraSettings();

;
; Write Log File
WriteLogFile();
;
;
; Fill Progressbar
While $ProgressBar.Value < 100;
Progress("Finalizing",20);
;
Loop;
;
Exit 1;
;================================================================


;***********************************************************************
;**
;** Update the clock
;**
Function UpdateClock()
If @Time<>$time
$Clock.Text=@Time
$time=@time
EndIf
EndFunction

;***********************************************************************
;**
;** Retrieve News File
;**
Function ShowNews()
$NewsRadioButton.Value=1
Progress( "Retrieving News")
If Open(1, $FileLocation + "\News.txt") = 0
$NewsLine = ReadLine(1)
While @ERROR=0
$NewsTextBox.Text=$NewsTextBox.Text + $NewsLine + Chr(13) + Chr(10)
$NewsLine = ReadLine(1)
Loop
If Close (1) <> 0
DbgMessage("Error","News File could not be closed", @SError)
EndIf
Else
DbgMessage("Debug","No News")
EndIf
$NewsRadioButton.Value=0
$NewsRadioButton.Enabled =0
EndFunction

;***********************************************************************
;**
;** Syncronize the local system time with the logon server. The PDC
;** server server-name syncronizes with NTP server
;**
Function SyncTime()
$TimeRadioButton.Value=1
DBGMessage ("Info", "Syncing Time:" )
Progress( "Syncing Time")
;If $NT_Mode="yes"
SetTime "\\server-name"; + $Lserver
If @ERROR<>0
DBGMessage ("Error", " - Error Finding Time Server : " + $Lserver )
Else
DbgMessage("Info"," - Synchronized time with : " + $Lserver)
;EndIf
;EndIf
$TimeRadioButton.Value=0
$TimeRadioButton.Enabled =0
EndFunction

;***********************************************************************
;**

;***********************************************************************


;** Connect Shares to Drives
;**
Function ConnectDrives()
$SharesRadioButton.Value=1
Progress( "Connecting Drives")
DbgMessage("Info","Connecting Home drive Drives:")
ConnectHomeDrive()

$SharesRadioButton.Value=0
$SharesRadioButton.Enabled =0

DbgMessage("Info","Connecting location drive")
COnnectlocationDrives()

DbgMessage("Info","Connecting default Drives:")
ConnectDefaultDrives()

DbgMessage("Info","Connecting group Drives:")
COnnectGroupDrives()

DbgMessage("Info","Connecting department Drives:")
COnnectdeptartmentDrives()


EndFunction

;***********************************************************************
;**
;** Connect Home Drive
;**
Function ConnectHomeDrive()
;******************************
; Home DriveShares
;******************************
Progress( "Connecting n:")



DbgMessage("Info","home folder - n: = " + @userid)

;Use n: /delete /persistent

Use n: "\\" + $lserver + "\" @userid + "$$"


If @ERROR = 1
DBGMessage ("HOMESHR","No Home Share available " + $lserver)
Else
DbgMessage ("Info","Home Share Connected " + @userid)

Return

EndIf
EndFunction

;***********************************************************************
;**
;****************************************
;** Connect DefaultShares to Drives *
;****************************************

Function ConnectDefaultDrives()

$mappingRadioButton.Value=1

use j: "\\server-name\apps$"
DbgMessage("Info","Default drives success")

Progress( "Connecting Application Drives:")

$mappingRadioButton.Value=0
$mappingRadioButton.Enabled =0

EndFunction


;***********************************************************************
;**
;****************************************
;** Connect location to Drives *
;****************************************

Function ConnectlocationDrives()

Progress( "Connecting l:")

$locationRadioButton.Value=1

$location = substr(@wksta, 1,7)

DbgMessage("Info","location - l: = " + $location)

Use; l: /delete

Use l: "\\server-name\$location"+"$"
If @ERROR = 1
DBGMessage ("location","No location Share available " + $lserver)
Else
DbgMessage ("Info","location Share Connected " + $location+"$")


EndIf

$locationRadioButton.Value=0
$locationRadioButton.Enabled=0
EndFunction


;***********************************************************************
;**
;****************************************
;** Connect GroupGroupDrives to Drives *
;****************************************

Function COnnectGroupDrives()

CALL "\\server-name\NETLOGON\main-group-drives.KIX"

Progress( "Connecting Group Drives:")

DbgMessage ("Info","Connecting group drive success ")

EndFunction


;*************************************************************************
;***********************************************************************

;**
;****************************************
;** Connect Deptartment Drives *
;****************************************

Function COnnectdeptartmentDrives()

CALL "\\server-name\NETLOGON\deptartment-Drives.kix"

Progress( "Connecting Department Drives")

DbgMessage ("Info","Connecting Department Drives success ")

endfunction
;***********************************************************************
;***********************************************************************


;**** printer setup ****
;
Function Installprinters()

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
if @inwin=1 ;>>>>>>>>>>>>> this is displaying a error code to be removed <<<<<<<<<<<<
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$debug_mode="no"

;CALL "\\server-name\NETLOGON\printers.kix"
$rc=DbgMessage ("Info","printers")

endif


EndFunction
;***********************************************************************

;************************************************************************
;**
;** Set Extra setting
;**
Function ExtraSettings()
$ExtraSettingsRadioButton.Value=1
Progress( "Setting Extra Settings")

DbgMessage("Info","Setting Extra settings:")

CALL "\\server-name\NETLOGON\extra.kix"


$ExtraSettingsRadioButton.Value=0
$ExtraSettingsRadioButton.Enabled=0
EndFunction
;************************************************************************
;
;************************************************************************
;**
;** Used to send email to the NT Administrator defined in $AdminEmail.
;** Attaches a copy of the local $DebugFile to the message so we can see
;** if there's a history of problems on the machine.
;**
;** Interprets the user's email address from their logon name. Both
;** logon names as well as email addresses are based on the employee's
;** insurance (employee) number.
;**
Function SendAdminMail()
If Len(DebugMessages)>1
Progress( "Sending Debug Report")
$UserEmail = @USERID + "@@" + $MailServer
; REM Run "POSTIE.exe -host:$MailServer -to:$AdminEmail -from:$UserEmail

-s:Logon_Script_Error_on_@WKSTA -msg:" + Chr(34) + "$DebugMessages"
EndIf
EndFunction

;************************************************************

;***********************************************************************
;**
;** Update Progress Bar
;**
Function Progress($ProgressText,optional $Step)
If $Step=""
$Step=$progressstep
EndIf
$ProgressTextBox.Text=$ProgressText
If $ProgressBar.Value + $Step < 101
$ProgressBar.Value=$ProgressBar.Value+$Step
If $DebugFlag = $TRUE
Sleep $sleeptime
EndIf
Else
$ProgressBar.Value=100
EndIf
$=Execute($Form.DoEvents())
EndFunction

;************************************************************
;** Function: DBGMessage
;** Usage: DBGMessage( "Debug", "This is a debug Message" )
;** DebugType : Info, Debug, Error
;**
Function DBGMessage($DebugType, $DebugMessage, Optional $SError)
Select
Case $DebugLevel="Error"
If $DebugType="Info" OR $DebugType="Debug"
Return
EndIf
Case $DebugLevel="Info"
If $DebugType="Debug"
Return
EndIf
EndSelect

If $DebugType="Error"
$numerrors=$numerrors+1
EndIf
$NumMessages=$NumMessages + 1
ReDim Preserve $DebugMessages[$NumMessages]

$DebugTime="" + @Date + " - " + @Time +" >"
$DebugText=$DebugType + " : " + $DebugMessage
If $SError<>""
$DebugText=$DebugText + " Additional Info: @SERROR"
EndIf

$DebugMessages[$NumMessages]=$DebugTime + $DebugText
If $DebugFlag = $TRUE
$DbgTextBox.Text=$DbgTextBox.Text + $DebugText + @CRLF
Sleep $sleeptime
EndIf
EndFunction

;************************************************************
;** Function: WriteLogfile
;** Usage: WriteLogFIle()
;**
Function WriteLogFile()
; Display DebugMessage
$WriteLogFileRadioButton.Value=1
Progress( "Writing Logfile")
$LogFile=$LoggingLocation + "\" + @Wksta + ".log"
If Exist($LogFile)
If GetFileSize($LogFile) > 1024 * 1024
Del($LogFile)
EndIf
EndIf

$NumMessages=$NumMessages + 1
ReDim PRESERVE $DebugMessages[$NumMessages]
$DebugMessages[$NumMessages]="-END----------------------------"

If Open(1, $LogFile,5) = 0
For $x=0 to $NumMessages
If WriteLine(1, $DebugMessages[$x] + @CRLF)<>0
DbgMessage("Error","DebugLine could not be written")
EndIf
Next
If Close(1)<>0
DbgMessage("Error","Log File could not be closed")
EndIf
Else
DbgMessage("Debug","Log file could not be written")
EndIf
$WriteLogFileRadioButton.Value=0
$WriteLogFileRadioButton.Enabled =0
EndFunction

;***********************************************************************
;**
;** calculates OS version with service pack
;**
Function OperatingSystem()
DbgMessage("Info","Checking Operating System")
Progress("Checking Operating System")

If (@inwin = 1)
$NT_mode="yes"
Else
$NT_mode="no"
EndIf

$os=""
$os_dos=@dos


$os_product=ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType")


$os_productSuite=ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions","ProductSuit

e")
$os_service_pack=""


$os_subversion=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion","SubVersionNumber")
Select
Case ($NT_mode = "yes") AND ($os_product <> "WinNT") AND ($os_dos = "5.1") AND

(InStr($os_productSuite,"Terminal Server") <> 0)
$os="XP_Terminal_Server"
Case ($NT_mode = "yes") AND ($os_product <> "WinNT") AND ($os_dos = "5.1") ; - Windows XP

Server
$os="XP_Server"
Case ($NT_mode = "yes") AND ($os_product = "WinNT") AND ($os_dos = "5.1") ; - Windows XP

Professional
$os="XP_Professional"
Case ($NT_mode = "yes") AND ($os_product <> "WinNT") AND ($os_dos = "5.0") AND

(InStr($os_productSuite,"Terminal Server") <> 0)
$os="W2K_Terminal_Server"
Case ($NT_mode = "yes") AND ($os_product <> "WinNT") AND ($os_dos = "5.0") ; - Windows 2000

-
$os="W2K_Server"
Case ($NT_mode = "yes") AND ($os_product = "WinNT") AND ($os_dos = "5.0")
$os="W2K_Professional"
Case ($NT_mode = "yes") AND ($os_product = "LANMANNT") ; - Windows NT -
$os="NT4_Domain_Controller"
Case ($NT_mode = "yes") AND ($os_product = "ServerNT") AND (InStr($os_productSuite,"Terminal

Server") <> 0)
$os="NT4_Terminal_Server"
Case ($NT_mode = "yes") AND ($os_product = "ServerNT")
$os="NT4_Member_Server"
Case ($NT_mode = "yes") AND ($os_product = "WinNT")
$os="NT4"
Case ($NT_mode <> "yes") AND (@dos = "4.90")
$os="ME"
Case ($NT_mode <> "yes") AND ($os_dos = "4.10") AND (InStr(Lcase($os_subversion),"c") <> 0)

; - Windows 98 -
$os="W98c"
Case ($NT_mode <> "yes") AND ($os_dos = "4.10") AND (InStr(Lcase($os_subversion),"b") <> 0)
$os="W98b"
Case ($NT_mode <> "yes") AND ($os_dos = "4.10") AND (InStr(Lcase($os_subversion),"a") <> 0)
$os="W98a"
Case ($NT_mode <> "yes") AND ($os_dos = "4.10")
$os="W98"
Case ($NT_mode <> "yes") AND ($os_dos = "4.0") AND (InStr(Lcase($os_subversion),"c") <> 0) ;

- Windows 95 -
$os="W95c"
Case ($NT_mode <> "yes") AND ($os_dos = "4.0") AND (InStr(Lcase($os_subversion),"b") <> 0)
$os="W95b"
Case ($NT_mode <> "yes") AND ($os_dos = "4.0") AND (InStr(Lcase($os_subversion),"a") <> 0)
$os="W95a"
Case ($NT_mode <> "yes") AND ($os_dos = "4.0")
$os="W95"
Case 1
$os="???" ; - undetermined -
EndSelect
;
$os_service_pack=""
Select
Case ($NT_mode = "yes") AND ($os_dos = "5.1") ; - Windows XP
$os_service_pack=ReadValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows

NT\CurrentVersion","BuildLab")
If (Len($os_service_pack) <> 0)
$os=SubStr($os,1,3)+"_"+Ltrim(Rtrim($os_service_pack))
$os_service_pack=Ltrim(Rtrim($os_service_pack))
EndIf
Case ($NT_mode = "yes") AND ($os_dos <> "5.1") ; Windows NT4 + W2K
$os_service_pack=ReadValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows

NT\CurrentVersion","CSDVersion")
If (Len($os_service_pack) <> 0)
$os=SubStr($os,1,3)+"_"+SubStr($os_service_pack,Len($os_service_pack),1)
$os_service_pack=Ltrim(Rtrim($os_service_pack))
EndIf
Case 1
; Windows 95, 98 + ME
EndSelect
;
$os_type=""
$os_dos=@dos
Select
Case ($NT_mode = "yes") AND ($os_dos = "5.1") ; - Windows XP -
$os_type="XP"
Case ($NT_mode = "yes") AND ($os_dos = "5.0") ; - Windows 2000 -
$os_type="W2K"
Case ($NT_mode = "yes") ; - Windows NT -
$os_type="NT4"
Case ($NT_mode <> "yes") AND ($os_dos = "4.90") ; - Windows ME -
$os_type="ME"
Case ($NT_mode <> "yes") AND ($os_dos = "4.10") ; - Windows 98 -
$os_type="W98"
Case ($NT_mode <> "yes") AND ($os_dos = "4.0") ; - Windows 95 -
$os_type="W95"
Case 1
$os_type="???" ; - undetermined -
EndSelect
DbgMessage("Info","$os")
$os_type=Ltrim(Rtrim(SubStr($os_type+" ",1,3)))
EndFunction

;***********************************************************************
;**
;** DrawForms()
;**
Function DrawForms()

; Form
$Form = CreateObject("Kixtart.Form")
$Form.Caption = "Stmsite Login Script"
$Form.Width = 500
$Form.Height = 400
If $DebugFlag=$True
$Form.Left=(1024 / 2) - (500 / 2)
$Form.Top=(768 / 2) - (400 /2 )
Else
$Form.Center
EndIf
; ClockTimer
$Timer = $Form.Timer(600,0,0,15,15)
$Timer.OnTimer = "UpdateClock()"

; Logo
$Logo=$Form.PictureBox
$Logo.Left=5
$Logo.Top=5
$Logo.Width=483
$Logo.Height=50
$Logo.Picture="\\server-name\netlogon\logo.bmp"

; Info Frame
$InfoFrame = $Form.Frame("Information",5,55,240,140)

$OSLbl = $InfoFrame.Label("Os", 5, 15, 115, 15)
$OSBox = $InfoFrame.TextBox("", 120, 15, 115, 15)
$OSBox.BackColor=$Form.BackColor
$OSBox.Enabled=0
$UserIdLbl = $InfoFrame.Label("UserId", 5, 30, 115, 15)
$UserIdBox = $InfoFrame.TextBox(@USERID , 120, 30, 115, 15)
$UserIdBox.BackColor=$Form.BackColor
$UserIdBox.Enabled=0
$FullNameLbl = $InfoFrame.Label("Full Name", 5, 45, 115, 15)
$FullNameBox = $InfoFrame.TextBox(@FULLNAME, 120, 45, 115, 15)
$FullNameBox.BackColor=$Form.BackColor
$FullNameBox.Enabled=0
$PriviledgeLbl = $InfoFrame.Label("Priviledge", 5, 60, 115, 15)
$PriviledgeBox = $InfoFrame.TextBox(@WKSTA, 120, 60, 115, 15)
$PriviledgeBox.BackColor=$Form.BackColor
$PriviledgeBox.Enabled=0
$WorkStnLbl = $InfoFrame.Label("Workstation", 5, 75, 115, 15)
$WorkStnBox = $InfoFrame.TextBox(@WKSTA, 120, 75, 115, 15)
$WorkStnBox.BackColor=$Form.BackColor
$WorkStnBox.Enabled=0
$DomainLbl = $InfoFrame.Label("Domain", 5, 90, 115, 15)
$DomainBox = $InfoFrame.TextBox(@DOMAIN, 120, 90, 115, 15)
$DomainBox.BackColor=$Form.BackColor
$DomainBox.Enabled=0
$ServerLbl = $InfoFrame.Label("Server", 5, 105, 115, 15)
$ServerBox = $InfoFrame.TextBox($LSERVER, 120, 105, 115, 15)
$ServerBox.BackColor=$Form.BackColor
$ServerBox.Enabled=0
$MemberLbl = $InfoFrame.Label("Group Member", 5, 120, 115, 15)
$MemberBox = $InfoFrame.TextBox(@ingroup, 120, 120, 115, 15)
$MemberBox.BackColor=$Form.BackColor
$MemberBox.Enabled=0

; Action Frame
$ActionFrame = $Form.Frame("Actions",250,55,240,140)

$NewsRadioButton = $ActionFrame.RadioButton("Get News", 5, 15, 230, 15)
$TimeRadioButton = $ActionFrame.RadioButton("Set Time", 5, 30, 230, 15)
$SharesRadioButton = $ActionFrame.RadioButton("Connect Drives", 5, 45, 230, 15)
$mappingRadioButton = $ActionFrame.RadioButton("Mapping Default Drives", 5, 60, 230, 15)
$locationRadioButton = $ActionFrame.RadioButton("Setting Location", 5, 75, 230, 15)
$printerRadioButton = $ActionFrame.RadioButton("Setting Printers", 5, 90, 230, 15)
$ExtraSettingsRadioButton = $ActionFrame.RadioButton("Extra Settings", 5, 105, 230, 15)
$WriteLogFileRadioButton = $ActionFrame.RadioButton("Write Logfile", 5, 120, 230, 15)

; Logging Frame
$NewsFrame = $Form.Frame("News",5,195,485,150)

$NewsTextBox = $NewsFrame.TextBox("",5,15,475,130)
$NewsTextBox.BackColor = $Form.BackColor
$NewsTextBox.MultiLine=1
$NewsTextBox.Enable=0
$NewsTextBox.Text=""
$NewsTextBox.ScrollBars=2
$NewsTextBox.Wordwrap=1

; Progress Bar
$ProgressTextBox= $Form.TextBox
$ProgressTextBox.Left=5
$ProgressTextBox.Top=350
$ProgressTextBox.Width=200
$ProgressTextBox.Height=20
$ProgressTextBox.Enable=0
$ProgressTextBox.BackColor = $Form.BackColor

$ProgressBar = $Form.ProgressBar
$ProgressBar.Left=210
$ProgressBar.Top=350
$ProgressBar.Width=220
$ProgressBar.Height=20
$ProgressBar.Style = 1

; Clock
$CurrentTime=@Time
$Clock = $Form.TextBox("",435,350,55,20)
$Clock.Alignment=2
$Clock.Enabled=0
$Clock.BackColor=$Form.BackColor

$Form.Show
; DebugForm
If $DebugFlag=$True
$DbgForm = CreateObject("Kixtart.Form")
$DbgForm.Caption = "DebugBox"
$DbgForm.Width = 260
$DbgForm.Height = 500
$DbgForm.Left=1024 -260
$DbgFOrm.Top=768 - 550

$DbgTextBox=$DbgForm.TextBox()
$DbgTextBox.Left=5
$DbgTextBox.Top=5
$DbgTextBox.Width=245
$DbgTextBox.Height=465
$DbgTextBox.MultiLine=1
$DbgTextBox.Enable=0
$DbgTextBox.Text=""
$DbgTextBox.ScrollBars=2
$DbgTextBox.Wordwrap=1

$CurrentX=0
$CurrentY=0
$DbgForm.Show
EndIf

EndFunction


Top
#45375 - 2003-09-09 07:51 PM Re: @userid on win98 & XP
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Use this and let me know result and if the path is a valid path.

You need to properly set the $lserver variable in the function first. Does that work? Then comment it out of the function and define it normally.

Please post the text returned from this function.


Function ConnectHomeDrive()
;******************************
; Home DriveShares
;******************************
Dim $Drive
$Drive = "N:"

Progress( "Connecting " + $Drive)


$lserver = "Your server"

Dim $path
$path = "\\" + $lserver + "\"+ @userid + "$$"

DbgMessage("Info","home folder - " + $Drive + " = " + $path )

Use $Drive /delete /persistent
DbgMessage("Info","use "+$Drive+" /delete Error: @error @serror")

Use $Drive $path
DbgMessage("Info","is this path ("+$path+") correct? - Error: @error @serror" )

EndFunction
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#45376 - 2003-09-09 07:53 PM Re: @userid on win98 & XP
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Here my is map mapdrive function. Maybe you can adapt it to your script.


Function MapDrive($Drive, $Server, $Share)
Dim $Drive, $Server, $Share
Color c+/n
If $Drive<>"" and $Server<>"" and $Share<>""
$LogText="Connecting $Drive to \\$Server\$Share"
? $LogText
USE $Drive /Delete /Persistent
USE $Drive "\\$Server\$Share"
If @error=0
color g+/n
$x=" - Success"
"$x"
Else
color r+/n
$x=" - Failed: Error @error"
"$x"
$ErrorState=1
Endif
WriteLog ($LogText + $x)
Color w+/n
Else
WriteLog ("Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'")
Endif
Endfunction


[ 09. September 2003, 19:54: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#45377 - 2003-09-10 10:31 AM Re: @userid on win98 & XP
ikmps Offline
Fresh Scripter

Registered: 2003-05-04
Posts: 37
Loc: Newcastle
Thanks for the script Howard

that work first time

looking at the script the change seems to be setting the server name again

Why should it loose it ????
would it be worth adding the line to other parts of the scrip

Thanks again

Paul

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 541 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.073 seconds in which 0.029 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