Jump to content

Kudzu309

Members
  • Posts

    10
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Kudzu309's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I've written and used an AutoIt script in the past to recursively search through directories and delete files that are X days old. As the script is searching through a directory, when it finds another directory it calls itself (it's is a function). Previously when it called itself it would wait until that instance completed before continuing, but now that I'm at the latest version of AutoIt (v3.3) it seems that it no longer waits. Is this a change in the way AutoIt works or compiles? The script is running on a Windows XP box. Also, I'm aware of this script that recursively searches a directory, but it would require a major re-write of my code, so I'd rather just fix what I've already written as it is much simpler Here is a slimmed-down example of my code: Searchdir (somedir) [Display log file] Func SearchDir($dir) $filehandle = FileFindFirstFile($dir & "*") If $filehandle = -1 Then Return While 1 $file = FileFindNextFile($filehandle) If @error Then ExitLoop If StringInStr(FileGetAttrib($dir & $file), "D") > 0 Then ;<------ checks if file is a directory SearchDir($dir & $file) Else PurgeOldFiles($dir, $file, $size, $shortdir);<----- function that deletes the file if it is X days old EndIf WEnd Return EndFuncThe reason I know it's exiting early is that after the routine that kicks off the search it displays a log file of what was deleted and it's now displaying an empty log file while it's still searching through directories. Thanks in advance for your help!
  2. I can't find a built-in function (in v3.3) to determine a remote machine's operating system. What is the simplest way to determine this accurately? Also, the account I'm using does have administrative access to the remote machines, if that helps. Thanks in advance!
  3. Looks like RunAsSet is in the 3.2.10 help file but it doesn't exist in the API: http://svn.autoitscript.com/trac/ticket/174. It is fixed in the 3.2.12 beta: 16th May, 2008 - v3.2.12.0 AutoIt: Removed: Unnecessary optional parameter from ProcessClose(). Removed: RunAsSet(). (Replaced with RunAs() and RunAsWait()) etc... ...but in the BugTrack it says that 3.2.10 supports RunAs, so here's the syntax if you don't want to load the beta: RunAs ( "username", "domain", "password", logon_flags, "filename" [, "workingdir" [, flag[, standard_i/o_flag]]] ) Steve
  4. I'm having the same issue. If I run it directly from the .au3 file it works fine, but if I execute the the compiled exe I gte the "unknown function" error on "line -1". If I comment out the RunAsSet the script works okay. I'm using Autoit v3.2.10 on Windows XP SP2. My machine doesn't have the RunAs service, but it has the Secondary Login service, which is running. I'm logged in with a domain regular user account, trying to execute something with a different domain user account. The reason is I need to copy files from a network share that the second domain user account can access. But what I'm attempting to do with the account doesn't seem to matter, as "unknown function name" seems to point to an error in the compiled exe. Could a recent MS security patch be causing this? Maybe I'll try the latest AutoIt beta.
  5. Is there some sort of function that can read how long the system has been idle? I don't have an immediate application, but I think it would come in handy if you wanted to run a script only when the PC is idle after X amount of time. I know that there isn't anything built into AutoIt, but I thought maybe someone would know of some type of OS call or something. Thanks, Steve
  6. I wrote a script that displayed some icons next to text buttons that perform different functions, and most of the icons are from c:\windows\system32\shell32.dll. I've been using the script and modifying it for about two months, but very recently many of the icons are missing or changed. I used a program to display all of the icons within shell32.dll (I used the same app when originally writing the script) and many of them have changed. Previously the icon numbers went up to 200-some, and now they go to 16721. I can see additional icons being added, but many of them have been moved around as well. I've tried clearing out the icon cache, but that hasn't helped. Any idea what's going on? Did some sort of Microsoft patch replace shell32.dll? And if icons have been moved around within Shell32.dll I would think that many other icons withing Windows would be screwed up, not just my little script. BTW, the app I'm using to view the icons within Shell32.dll is Nirsoft's IconExtract: http://www.nirsoft.net/utils/iconsext.html and I'm using Windows XP Pro.
  7. Ahh, thanks for the tip. I was using the AutoIt Window Info to outline the peices of the window. Steve
  8. Oops, I guess that I didn't look at it closely enough (sorry, was in a hurry at the time). Somehow I never saw AutoIt's GUISetBkColor function and was using GUICtrlSetBkColor instead to color the labels. Thanks again for your help!
  9. Thanks Valuater, but I had copied the code of that out of a larger script that I had written, that does have #include <GuiConstants.au3> in the beginning, so unfortunately that's not the problem, but thanks for your reply.
  10. Hi, I've created a window that I would like to be solid red with a message and a button to click to view a log file. GUICreate ("program",300,200,-1,-1,$WS_SYSMENU) GUICtrlCreateLabel (@LF & "Program FAILED.",1,1,300,200,$SS_CENTER) GUICtrlSetFont (-1,20) GUICtrlSetColor (-1,0xffffff) GUICtrlSetBkColor (-1,0xff0000) $ViewLog = GUICtrlCreateButton ("View Log",130,125,-1,-1,-1) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $ViewLog then RunWait(@ComSpec & " /c notepad c:\logfile.log", "", @SW_HIDE) ExitLoop EndIf Wend The problem is that the label seems to "cover up" the button so that I can't click on it, even though it's completely visible. I found this out by decreasing the size of the label until it was above the button and then I could click on it. I also tried putting GUICtrlCreateButton before GUICtrlCreateLabel, which even made is stranger; the button wasn't visible until the mouse was over it, and then it became visable and clickable. Very weird. Is there a different way to make the window red? Is there a way to force the button to be "on top" of the label so it's clickable? Thanks.
×
×
  • Create New...