oshaker
Active Members-
Posts
32 -
Joined
-
Last visited
oshaker's Achievements
Seeker (1/7)
0
Reputation
-
The machine will show a message at log off that it can't write to templates folder.
-
Hello, I have one user for which I set up a roaming profile, this user is used to log on to 300 PCs, I noticed that at log off PCs update the roaming profile. I need a quick method to prevent local machines from updating roaming profile on server when they log off, this will make life easier. I also found good practices to include in a script: Hive: HKEY_LOCAL_MACHINE Key: SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon Name: DeleteRoamingCache Type: REG_DWORD Value: 1 To prevent logging to EventLog: Hive: HKEY_LOCAL_MACHINE Key: SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon Name: EventLog Type: REG_DWORD Value: 0 You will have to stop and restart the spooler from services in the Control Panel but you may wish to reboot. If you want roaming profiles to not include certain folders, you can exclude them. Excluding internet temporary files, cookies, and outlook files can keep the roaming profile small. To exclude folders: Hive: HKEY_CURRENT_USER Key: SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon Name: ExcludeProfileDirs Type: REG_SZ Value: Temporary Internet Files;Cookies;Recent;History;Local Settings\Application Data\Microsoft\Outlook But I don't think they solve the roaming profile updating problem when PCs log off. I don't know if there are other solutions to this problem, or if this behavior for roaming profiles can be changed. The funny thing is that I am using a mandatory profile, I don't understand why PCs update the roaming profile after all. Thanks
-
This is better: ([0-9]+\-) with count = 1 using StringRegExpReplace function
-
I have strings like this: 1. abcd xx-xx-x 2. abcd xx-xx-xx 3. abcd xx-xx-xxx Text I want to remove is in red, the rest of the string i.e. "abcd" is not fixed. I need to make them like this: abcd xx-xx What is the pattern I can use to achieve this? I am using StringRegExpReplace function
-
#include "mysql.au3" $objErr = ObjEvent("AutoIt.Error","MyErrFunc") Dim $var, $sql $sql = _MySQLConnect("UserName","Password","DB_Name","DB_IP_Address") $var = _Query($sql,"SELECT user.user_id, user.firstname,user.username,course.code FROM dokeos_main.user ,dokeos_main.course_rel_user, dokeos_main.course where user.user_id=course_rel_user.user_id and course_rel_user.course_code=course.code" ) FileOpen ( "c:\test.txt", 130) With $var While NOT .EOF FileWriteLine("c:\test.txt",.Fields("username").value & "," & .Fields("firstname").value & .Fields("code").value & @CRLF) .MoveNext WEnd EndWith _MySQLEnd($sql) Func MyErrFunc() $hexnum=hex($objErr.number,8) Msgbox(0,"","We intercepted a COM Error!!" & @CRLF & @CRLF & _ "err.description is: " & $objErr.description & @CRLF & _ "err.windescription is: " & $objErr.windescription & @CRLF & _ "err.lastdllerror is: " & $objErr.lastdllerror & @CRLF & _ "err.scriptline is: " & $objErr.scriptline & @CRLF & _ "err.number is: " & $hexnum & @CRLF & _ "err.source is: " & $objErr.source & @CRLF & _ "err.helpfile is: " & $objErr.helpfile & @CRLF & _ "err.helpcontext is: " & $objErr.helpcontext _ ) exit EndFunc This gives me: Only Object-type variables allowed in a "With" statement. With $var With ^ ERROR How can I fix it?
-
Subscript used with non-Array variable _FileListToArray
oshaker replied to oshaker's topic in AutoIt General Help and Support
I had to restart PC and it works fine really strange... -
Subscript used with non-Array variable _FileListToArray
oshaker replied to oshaker's topic in AutoIt General Help and Support
including array.au3 doesn't work.. here is the compelte code: #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.0.0 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here ; Script Start - Add your code below here #NoTrayIcon AutoItSetOption("MustDeclareVars", 1) #include <String.au3> #Include <Array.au3> #include <File.au3> ; Define Variables Dim $FileHandle, _ $LinesCount, _ $CoursePath, $PathToBuild, $FolderList, _ $NumberOfCourses, _ $i, $n, $c, $d, _ $FileToRead = "Course_Paths.txt" ; Get file handle $FileHandle = FileOpen($FileToRead, 0) ; Exit if error If @error <> -1 Then ; Count lines in file $LinesCount = _FileCountLines($FileToRead) ; Exit if count = 0 or error If $LinesCount = 0 Or @error = 1 Then Exit For $i = 1 To $LinesCount $CoursePath = FileReadLine($FileHandle, $i) If StringInStr($CoursePath, "'", 2) = 0 Then $CoursePath = StringSplit($CoursePath, "\") $NumberOfCourses = $CoursePath[$CoursePath[0]] ;MsgBox(0, "", $NumberOfCourses) For $n = 1 To $NumberOfCourses For $c = 1 To $CoursePath[0] - 2 $PathToBuild = $PathToBuild & $CoursePath[$c] If $c <> $CoursePath[0] - 2 Then $PathToBuild = $PathToBuild & "\" EndIf Next If $n < 10 Then $PathToBuild = $PathToBuild & "0" & $n Else $PathToBuild = $PathToBuild & $n EndIf $PathToBuild = $PathToBuild & "\" & $CoursePath[$CoursePath[0]-1] & "\" ;MsgBox(0, "", $PathToBuild) ;FileDelete($PathToBuild) $FolderList = _FileListToArray($PathToBuild, "*", 2) MsgBox(0, "", $FolderList) For $d = 1 To $FolderList[0] If @error = 0 Then MsgBox(0, "", $FolderList[$d]) MsgBox(0, "", UBound($FolderList)) DirRemove($PathToBuild & "\" & $FolderList[$d], 1) EndIf Next $PathToBuild = "" Next EndIf Next FileClose($FileHandle) EndIf -
Subscript used with non-Array variable _FileListToArray
oshaker replied to oshaker's topic in AutoIt General Help and Support
_FileListToArray $FolderList = _FileListToArray($PathToBuild, "*", 2) For $d = 1 To UBound($FolderList) If @error = 0 Then DirRemove($PathToBuild & "\" & $FolderList[$d], 1) EndIf Next Compiler is complaining about For $d = 1 To UBound($FolderList) and gives the error Subscript used with non-Array variable -
$FolderList = _FileListToArray($PathToBuild, "*", 2) For $d = 1 To $FolderList[0] DirRemove($PathToBuild & "\" & $FolderList[$d], 1) Next Compiler is complaining about this line: For $d = 1 To $FolderList[0] Error: Subscript used with non-Array variable I have to use UBound($FolderList) Any clue for this problem?
-
Login fails for me too. That's strange, my credentials are OK. I can manually download the check file, thu the script cannot.
-
I asked this question because there are instances when option 4 works, while option 2 doesn't. This happens when I try to run Symantec Endpoint Client setup on a machine logged with a limited domain user. Option 2 never worked although the setup ran, but a message appeared complaining about priviliges, while option 4 ran the setup with administrator credentials and installed the client, successfully. The command is: RunAs("AdminUser" "Domain", "AdminPassword", 4, "\\Server\Sharename\Setup.exe")
-
What does each option in the logon_flag for RunAs function means: 0 - Interactive logon with no profile. 1 - Interactive logon with profile. 2 - Network credentials only. 4 - Inherit the calling processes environment instead of the user's.
-
What is the safe way for TCP reconnect
oshaker replied to oshaker's topic in AutoIt General Help and Support
Guys where are you?