ter-pierre Posted October 8, 2004 Posted October 8, 2004 Hi Any one knows why the NETLOGON share still mapped after the logon script execution? Im using Aut2Exe to generate .exe files that are executed during the logon tks Pierre
ter-pierre Posted October 8, 2004 Author Posted October 8, 2004 NOTE: This just in Windows95/98 workstations
ioliver Posted October 8, 2004 Posted October 8, 2004 Can you post your code, and I'll try to take a look at it... Thanks, Ian "Blessed be the name of the Lord" - Job 1:21Check out Search IMF
ter-pierre Posted October 11, 2004 Author Posted October 11, 2004 Here is... ----------------------------------------------------------------------------------------------- ;region Script Settings ;<settings><scriptpackager><process></process> ;<arguments>teste.au3</arguments> ;<extractdir>%TEMP%</extractdir> ;<outputdir>U:\AUTOIT</outputdir> ;<files></files> ;<usedefaulticon>True</usedefaulticon> ;<icon></icon> ;<showinsystray>True</showinsystray> ;<tooltip></tooltip> ;<username></username> ;<domain></domain> ;<abortonfail>True</abortonfail> ;<product></product> ;<internalname></internalname> ;<version>1.0.0.1</version> ;<versionstring></versionstring> ;<description></description> ;<comments></comments> ;<company></company> ;</scriptpackager> ;</settings> ; ;endregion ;############################################################################## Break (1) If StringLeft (@IPAddress1,7)="10.1.1." Or StringLeft (@IPAddress1,7)="10.1.2." Or StringLeft (@IPAddress1,7)="10.1.3." Or StringLeft (@IPAddress1,7)="10.1.4." Then skip () ;############################################################################## If StringLeft (@IPAddress1,7)="10.211." Then $SERVER="\\PTMAI" $DC="\\PTMAI" $PROXY="PTMAI" If StringLeft (@IPAddress1,7)="10.2.1." Then $SERVER="\\BRSPO" $DC="\\BRSPO" $PROXY="PROXY" If StringLeft (@IPAddress1,5)="10.1." Then $SERVER="\\BRJGS1" $DC="\\brjgs2" $PROXY="PROXY" If FileExists("\\brjgs3\development$") Then If FileExists ("X:\UTIL") Then Else drivemapadd ("X:","\\brjgs3\development$",1) EndIf EndIf Run ($SERVER & "\MENS$\frases.exe",$SERVER & "\MENS$\") RunWait (@ComSpec & " /c " & $SERVER & '\ofces$\antivirus.exe',@ScriptDir, @SW_HIDE) If @WDay="4" Then Run ($SERVER & '\invent$\inventario\inventario.exe',@ScriptDir, @SW_HIDE) EndIf $PROXYKEY="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" RegWrite ($PROXYKEY,"ProxyEnable","REG_DWORD","00000001") RegWrite ($PROXYKEY,"ProxyServer","REG_SZ","BRJGS111:3128") RegWrite ($PROXYKEY,"ProxyOverride","REG_SZ","*empresa.*;localhost;<local>;172.27.*") RegWrite ($PROXYKEY,"EnableAutodial","REG_DWORD","00000000") RunWait(@ComSpec & " /c " & $DC & '\netlogon\kix32.exe ' & $DC & '\netlogon\br\sc\jgs\oracle93.kix',@ScriptDir, @SW_HIDE) ;$oracle93=$DC & "\netlogon\kix32.exe " & $DC & "\netlogon\br\sc\jgs\oracle93.kix" ;RunWait ($oracle93) If @WDay="5" Then RunWait(@ComSpec & " /c " & $DC & '\netlogon\kix32.exe ' & $DC & '\netlogon\br\sc\jgs\Fixfinal03.kix',@ScriptDir, @SW_HIDE) EndIf RunWait(@ComSpec & " /c " & $DC & '\netlogon\kix32.exe ' & $DC & '\netlogon\br\sc\jgs\sus.kix',@ScriptDir, @SW_HIDE) RunWait(@ComSpec & " /c " & $DC & '\netlogon\kix32.exe ' & $DC & '\netlogon\br\sc\jgs\TNSNETWORK.kix',@ScriptDir, @SW_HIDE) ;RunWait(@ComSpec & " /c " & $DC & '\netlogon\kix32.exe ' & $DC & '\netlogon\br\sc\jgs\MEMBEROF.kix',@ScriptDir, @SW_HIDE) If @WDay="6" Then If @OSType="WIN32_WINDOWS" Then $TIMEKEY="HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Time Zones\E. South America" RegWrite ($TIMEKEY,"Display","REG_SZ","(GMT-03:00) Brasilia - Horario WEG Brasil") RegWrite ($TIMEKEY,"Dlt","REG_SZ","Horario brasileiro de verao") RegWrite ($TIMEKEY,"Std","REG_SZ","Hora oficial do Brasil") RegWrite ($TIMEKEY,"MapID","REG_SZ","-1,80") RegWrite ($TIMEKEY,"Index","REG_DWORD","41") RegWrite ($TIMEKEY,"TZI","REG_BINARY","b400000000000000c4ffffff0000020000000300020000000000000000000a00000003000200000000000000") $TIMEKEY="HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" RegWrite ($TIMEKEY,"ActiveTimeBias","REG_BINARY","78000000") RegWrite ($TIMEKEY,"StandardName","REG_SZ","Horario oficial brasileiro") RegWrite ($TIMEKEY,"DaylightName","REG_SZ","Horario brasileiro de verao") RegWrite ($TIMEKEY,"Bias","REG_BINARY","b4000000") RegWrite ($TIMEKEY,"StandardBias","REG_BINARY","00000000") RegWrite ($TIMEKEY,"DaylightBias","REG_BINARY","c4ffffff") RegWrite ($TIMEKEY,"StandardStart","REG_BINARY","00000200000003000200000000000000") RegWrite ($TIMEKEY,"DaylightStart","REG_BINARY","00000a00000003000200000000000000") RegWrite ($TIMEKEY,"DaylightFlag","REG_BINARY","02000000") RegWrite ($TIMEKEY,"DisableAutoDaylightTimeSet","REG_DWORD","1") Else $TIMEKEY="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time" RegWrite ($TIMEKEY,"Display","REG_SZ","(GMT-03:00) Brasilia - Horario WEG Brasil") RegWrite ($TIMEKEY,"Dlt","REG_SZ","Horario brasileiro de verao") RegWrite ($TIMEKEY,"Std","REG_SZ","Horario oficial brasileiro") RegWrite ($TIMEKEY,"MapID","REG_SZ","-1,80") RegWrite ($TIMEKEY,"Index","REG_DWORD","00000041") RegWrite ($TIMEKEY,"TZI","REG_BINARY","b400000000000000c4ffffff0000020000000300020000000000000000000a00000003000200000000000000") $TIMEKEY="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" RegWrite ($TIMEKEY,"Bias","REG_DWORD","180") RegWrite ($TIMEKEY,"StandardName","REG_SZ","Hora oficial do Brasil") RegWrite ($TIMEKEY,"StandardBias","REG_DWORD","00000000") RegWrite ($TIMEKEY,"StandardStart","REG_BINARY","00000200030002000000000000000000") RegWrite ($TIMEKEY,"DaylightName","REG_SZ","Horario brasileiro de verao") RegWrite ($TIMEKEY,"DaylightBias","REG_DWORD","00000000") RegWrite ($TIMEKEY,"DaylightStart","REG_BINARY","00000200030002000000000000000000") RegWrite ($TIMEKEY,"ActiveTimeBias","REG_DWORD","180") RegWrite ($TIMEKEY,"DisableAutoDaylightTimeSet","REG_DWORD","1") EndIf EndIf RunWait(@ComSpec & " /c " & 'net time ' & $DC & ' /Set /yes',@ScriptDir, @SW_HIDE) skip() Func skip () $SUBNET= StringLeft (@IPAddress1,7) If $SUBNET="10.1.1." Or $SUBNET="10.1.2." Or $SUBNET="10.1.3." Or $SUBNET="10.1.4." Then $MFID= StringRight (@ComputerName,3) If $MFID >= 119 And $MFID <= 126 Then Run ("RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n ""cypress""") EndIf EndIf $USER=@UserName&"$" If FileExists("\\BRJGS8\HOME003$\"&@UserName) Then drivemapadd ("U:","\\BRJGS8\"&$USER) If InGroup("_GG_MAP_V") Then drivemapadd ("V:","\\BRJGS8\HOME003$") EndIf EndIf If FileExists("\\BRJGS9\HOME004$\"&@UserName) Then drivemapadd ("U:","\\BRJGS9\"&$USER) If InGroup("_GG_MAP_V") Then drivemapadd ("V:","\\BRJGS9\HOME004$") EndIf EndIf If FileExists("Q:\APPS\_UTIL") Then Else drivemapadd ("Q:","\\BRJGS10\DFSWEG",1) If @OSType="WIN32_WINDOWS" Then $CNT=0 Do If FileExists("Q:\APPS\_UTIL") Then $CNT=3 Else drivemapadd ("Q:","\\BRJGS10\DFSWEG",1) $CNT=$CNT+1 Sleep (10000) Until $CNT=3 EndIf EndIf If $SUBNET="10.1.1." Or $SUBNET="10.1.2." Or $SUBNET="10.1.3." Or $SUBNET="10.1.4." Then Exit ;EndIf If InGroup("_GG_DFSWEG_APPS_GECEX") Or InGroup("_GG_DFSWEG_APPS_GECEX_ESPECIAL_01") Or InGroup("_GG_DFSWEG_APPS_FLOW_CHARTING")Then drivemapadd ("M:","\\BRJGS10\APPS$") EndIf If @OSType="WIN32_WINDOWS" Then $VAL=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD", "CurVer") If $VAL="R14.0" Then drivemapadd ("K:","\\BRJGS9\GROUPS$") drivemapadd ("L:","\\BRJGS10\PUBLIC$") EndIf EndIf EndFunc Exit Func InGroup($GROUP) $groupnamelength = StringLen ($group) If $groupnamelength > 21 Then $groupnamelength = 21 EndIf $groupnamearray = StringSplit ($GROUP,"") $group = "" For $groupcharactercount = 1 to $groupnamelength $group=$group & $groupnamearray[$groupcharactercount] Next ;Get the user details and pipe to a text file $tempfile = tempfile() RunWait(@ComSpec & " /c net user /Domain" & " " & @UserName & " >" & $tempfile, "", @SW_HIDE) ; Open textfile output from cmd net user $FILE = FileOpen($tempfile, 0) ; Check if file opened for reading OK If $FILE = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in file until the EOF is reached, if user is in group return 1 (true) or else 0 (false) While 1 $LINE = FileReadLine($FILE) & " " If @error = -1 Then FileClose($FILE) FileDelete($tempfile) ExitLoop EndIf If StringInStr($LINE, "*" & $GROUP & " ") Then FileClose($FILE) FileDelete($tempfile) Return 1 EndIf WEnd EndFunc ;==>InGroup Func tempfile() For $TRY = 1 To 100 ; Try 100 times to create a tempfile, if no success $TEMPNAME = "~" ; create 7 random chars and ad them to the tempfile name For $I = 0 To 6 $RND = Random(97, 122) $RND = Round($RND, 0) $TEMPNAME = $TEMPNAME & Chr($RND) Next $TEMPNAME = @TempDir & "\" & $TEMPNAME & ".tmp"; add path and ".tmp" to the tempfilename. $TEMPFH = FileOpen($TEMPNAME, 0) If $TEMPFH = -1 Then $TEMPFH = FileOpen($TEMPNAME, 2) If $TEMPFH = -1 Then ; if can not open the file then something is gone wrong. Else FileClose($TEMPFH) Return ($TEMPNAME) EndIf EndIf If $TEMPFH = 1 Then ; If file allready exists, its not the file just created FileClose($TEMPFH) ; opened a file from something else. Close it EndIf Next EndFunc ;==>tempfile
MattX Posted October 11, 2004 Posted October 11, 2004 Good lord, that's one hell of a logon script - and there was thinking mine at around 10 lines was large....
nobby Posted October 12, 2004 Posted October 12, 2004 Since there is no mapping z: to netlogon in your script, the issue must be coming from another logon script or a "persistent" mapping done at the workstation level. If it is an issue, you can always delete the mapping at the end of the script.. CheersNobby
ter-pierre Posted October 14, 2004 Author Posted October 14, 2004 in tests i do a new installation of windows98 and the problems still. No persistent maps, no any other script. I supose that the temporary map pointng to NETLOGON that is automaticaly created during the logon process, still mapped after the logon process finish. If i change the script from AutoIt to KIX the problem do not occours. I think that is linked with Aut2Exe and windows95/98... Pierre
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now