[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 ]
#45368 - 2003-09-0905:10 PMRe: @userid on win98 & XP
Howard BullockHoward Bullock
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?
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
#45371 - 2003-09-0905:23 PMRe: @userid on win98 & XP
Howard BullockHoward Bullock
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 ]
;;;;;;;adding debug menu for admin or support accounts ;;;;;;;;;; ; if ingroup ("main admin grp") or ingroup ("support accounts"); $debug=1; else ; $debug=0; endif; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;======================================================== ; ; main server name ; ;$Lserver = "server-ip-address"; $LServer = "server-name" ; ;=======================================================
;*********************************************************************** ;** ;** 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
;**** printer setup **** ; Function Installprinters()
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< if @inwin=1 ;>>>>>>>>>>>>> this is displaying a error code to be removed <<<<<<<<<<<< ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $debug_mode="no"
;************************************************************************ ;** ;** 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
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_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()