Jump to content

CGRemakes

Active Members
  • Posts

    44
  • Joined

  • Last visited

CGRemakes's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I'm attempting to generate an email that has the subject and body already filled in. I want the "To" to be left blank for the user to fill in. The body of the message has the potential to be very long, and I'm running into the character limits if I do a ShellExecute(mailto:blah,blah,blah) command. Is there any way around this? We use Lotus Notes, but I would like to make it generically just open the user's default email client. Is there a way to pull this off?
  2. Here is a very simple example of what I'm trying to do: I have this code in 1 file: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WinAPI.au3> $ShutDownWindowTimeout=800 $UserActionMessage = "SHUTDOWN" $pTitle = DllStructCreate("char Title[32]") $pMessage = DllStructCreate("char Message[128]") $pResponse = DllStructCreate("DWORD Response") $KernelCall = DllOpen(@SystemDir & "Kernel32.dll") $SessionId = DllCall($KernelCall, "DWORD", "WTSGetActiveConsoleSessionId") DllClose($KernelCall) DllStructSetData($pTitle, "Title", "Scheduled Power Action") DllStructSetData($pMessage, "Message", "Your computer is scheduled to " & $UserActionMessage & ". Click CANCEL to keep working.") $wtsapiCall = DllOpen(@SystemDir & "Wtsapi32.dll") $SendMessageResult = DllCall($wtsapiCall,"BOOL","WTSSendMessageA","HANDLE","WTS_CURRENT_SERVER_HANDLE","DWORD",$SessionId[0],"str",DllStructGetData($pTitle, "Title"),"DWORD",DllStructGetSize($pTitle),"str",DllStructGetData($pMessage, "Message"),"DWORD",DllStructGetSize($pMessage),"DWORD",49,"DWORD",$ShutDownWindowTimeout,"DWORD",DllStructGetPtr($pResponse),"BOOL","1") $SendMessageResult[3] & "," & $SendMessageResult[4] & "," & $SendMessageResult[5] & "," & $SendMessageResult[6] & "," & $SendMessageResult[7]& $SendMessageResult[8] & "," & $SendMessageResult[9] & "," & $SendMessageResult[10]) DllClose($wtsapiCall) Which I compile and run the .exe just as the currently logged in user. I then have another program that runs the following code: MsgBox(0, "TEST", ControlSetText("Scheduled Power Action", '', "Static2", "Test 213")) On XP, it changes the text and returns that it worked. On W7, it does not change the text and returns "0". However, if I run the following code on W7: MsgBox(0, "TEST", ControlGetText("Scheduled Power Action", "", "Static2")) Then it displays the correct "Your computer is scheduled to REBOOT. Click CANCEL to keep working." text from the message box alert, so it does detect that it exists....it just can't seem to change it.
  3. I did a search and found this post: That solution works great to display the message. How would I dynamically update the count down message so they know when it's going to automatically perform the action? And is it possible to edit the text in the buttons? I want it to be more apparent that they are simply pausing the action. Yes, I could say "Click Cancel to pause", but I'd rather not if I can avoid it. I'd like to "stupid proof" it as much as possible. EDIT: Nevermind, figured it out. I didn't know you could interact with that message box just like the MsgBox control. EDIT EDIT: Still having some issues. It seems W7 is unable to change text or button information (even if I just run it as a regular user, it returns "0" when I run the ControlSetText command). It just sticks with whatever it was when it was created. Is there any other way to pull it off using wtssendmessage? That seems to be the way to go.
  4. The agent is running as the service account, but is spawning sub processes as a different user that has that ability.
  5. I've done it both ways with the same result: no interaction. EDIT: Just a note, I changed the _Service_Create to this: _Service_Create($sServiceName, "Au3Service " & $sServiceName, BitOR($SERVICE_WIN32_OWN_PROCESS, $SERVICE_INTERACTIVE_PROCESS), $SERVICE_AUTO_START, $SERVICE_ERROR_SEVERE, '"' & @ScriptFullPath & '"') But still, no luck. Before, I was manually setting the "interact" flag to on, but now it should be created with it on. I can verify it's checked after it's created.
  6. I know doing a GUI from a service is not recommended and not possible in newer OSes. What I'm trying to do is spawn a subprocess as a different user to handle the GUI. It works great on XP, but never displays the GUI on W7. As far as I understand it, this should be possible. I'm using the service UDF from this thread: This is a small portion of the code to show what I'm doing: Func _CheckReboot() If $REQUIRE_REBOOT = True AND (Not $LAST_REBOOT_PAUSE_TIME OR _Timer_Diff($LAST_REBOOT_PAUSE_TIME) >= 3600000) Then Local $msg = "An application installed and requires a reboot to complete." Local $flag = 48 If $REBOOT_PAUSES_REMAINING > 0 Then $msg &= " Reboot or pause (" & $REBOOT_PAUSES_REMAINING & " remaining)" $flag = 49 EndIf Local $iMsg = _MsgBoxEx($flag, 'System Reboot', $msg, 'Reboot|Pause', 300) If $iMsg = 1 OR $iMsg = -1 Then ;Either "Reboot" was clicked or timeout ran out, so reboot Shutdown(22) Else $LAST_REBOOT_PAUSE_TIME = _Timer_Init() $REBOOT_PAUSES_REMAINING -= 1 EndIf EndIf EndFunc Func _MsgBoxEx($iFlag, $sTitle, $sText, $sCIDChange, $iTimeout = 0) Return RunAsWait($USERNAME, @ComputerName, $PASSWORD, 1, @AutoItExe & ' /msgbox ' & $iFlag & ' "' & $sTitle & '" "' & $sText & '" "' & $sCIDChange & '" ' & $iTimeout, @ScriptDir, @SW_HIDE) EndFunc ;==>_MsgBoxEx Then in the portion where I handle command line switches, I have the following code: If $cmdline[0] > 0 Then Switch $cmdline[1] Case "install", "-i", "/i" ;~ msgbox(0,"","toto") InstallService() Case "remove", "-u", "/u", "uninstall" RemoveService() Case "/download" Exit _DownloadFilesCmd() Case "/msgbox" Exit _MsgBoxExCmd() Case Else ConsoleWrite(" - - - Help - - - " & @CRLF) ConsoleWrite("params : " & @CRLF) ConsoleWrite(" -i : install service" & @CRLF) ConsoleWrite(" -u : remove service" & @CRLF) ConsoleWrite(" - - - - - - - - " & @CRLF) Exit ;start service. EndSwitch Else _Service_init($sServiceName) Exit EndIf The /msgbox flag calls the _MsgBoxExCmd() function, which is basically a MsgBox that displays and notifies them their computer will be rebooted. They have the option to reboot then or pause it. It will constantly refresh to show a countdown (code taken from Gary Frost I believe): Func _MsgBoxExCmd() Local $Static = "Static1" Local $iFlag = $CmdLine[2] Local $sTitle = $CmdLine[3] Local $sText = $CmdLine[4] Local $sCIDChange = StringSplit($CmdLine[5], "|") Local $iTimeout = $CmdLine[6] ;Local $sCIDChange[3] = ['', 'Reboot', 'Pause'] Local $_MsgBox_ If BitAND($iFlag, 16) Or BitAND($iFlag, 32) Or BitAND($iFlag, 48) Or BitAND($iFlag, 64) Then $Static = "Static2" If $iTimeout Then $_MsgBox_ = '"' & "ConsoleWrite(MsgBox(" & $iFlag & ', ""' & $sTitle & '"", ""' & $sText & @LF & @LF & @LF & '"", ' & $iTimeout & '"))' Else $_MsgBox_ = '"' & "ConsoleWrite(MsgBox(" & $iFlag & ', ""' & $sTitle & '"", ""' & $sText & '"", ' & $iTimeout & '"))' EndIf Local $iPID = Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $_MsgBox_, '', @SW_MAXIMIZE, 6) Do Sleep(10) Until WinExists($sTitle) For $iCC = 1 To $sCIDChange[0] ControlSetText($sTitle, '', 'Button' & $iCC, $sCIDChange[$iCC]) Next If $iTimeout Then _CountDown($sTitle, $sText, $iTimeout, $iPID, $Static) Local $iStdOut = StdoutRead($iPID) ; waiting... If Number($iStdOut) Then $returncode = $iStdOut ElseIf IsArray($sCIDChange) Then $returncode = 2 Else $returncode = 1 EndIf Return $returncode EndFunc Func _CountDown($sTitle, $sText, $iTimeout, $iPID, $Static) Local $orig_text = $sText, $now = -999, $now = @SEC ControlSetText($sTitle, "", $Static, $orig_text & @LF & @LF & "This will automatically execute in " & $iTimeout & " second(s)!", 1) While Not Number(StdoutRead($iPID, 2, True)) If $now <> @SEC Then $iTimeout -= 1 $now = @SEC If $iTimeout Then ControlSetText($sTitle, "", $Static, $orig_text & @LF & @LF & "This will automatically execute in " & $iTimeout & " second(s)!", 1) EndIf Sleep(10) WEnd EndFunc ;==>_CountDown If I just run the main program as either the current user or administrator on W7, it works as expected. However, when I run the program as a service, it never displays. It does reboot automatically after a set period of time (which is the correct behaviour if there is no interaction with the msgbox). I looked at the process list, and there are 2 sub processes spawned, both showing the user that I specified in $USERNAME in the _MsgBoxEx() function. Any thoughts? Here is a functioning example. You will need to have the necessary service files from the first post of the service UDF thread, and you will need to change "$USERNAME" and "$PASSWORD" to something that will work on your system, but should be good to go. #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=beta #AutoIt3Wrapper_Change2CUI=y #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;~ Opt("MustDeclareVars", 1) ; just for self control FPRIVATE "TYPE=PICT;ALT=smile.gif" dont to forget declare vars Global $MainLog = @ScriptDir & "test_service.log" FileDelete($MainLog) Global $sServiceName = "Autoit_Service" Global $bServiceRunning = False, $iServiceCounter = 1 Global $hGUI Global $bDebug = False Dim $REQUIRE_REBOOT = True Dim $REBOOT_PAUSES_REMAINING = 3 Dim $LAST_REBOOT_PAUSE_TIME Dim $USERNAME = "username" Dim $PASSWORD = "password" #include "services.au3" #include <Timers.au3> ; i used it for timers func #include <File.au3> #include <Constants.au3> #include <Date.au3> #include <String.au3> #include <Array.au3> ; Thread safe ; Thread safe ;~ OnAutoItExitRegister("_exit") ; $bDebug = False Func main($iArg, $sArgs) #region -- STOP STOP STOP STOP - Don't change anything -- Service Start ; Arcker 02/03/2012 If $bDebug Then logprint("***** & _Service_ServiceMain & *******" & @CRLF) $ret = DllCall($hAdvapi32_DLL, "hwnd", "RegisterServiceCtrlHandler", "ptr", DllStructGetPtr($tServiceName), "ptr", DllCallbackGetPtr($tServiceCtrl));register service If $ret[0] = 0 Then logprint("Error in registering service" & _WinAPI_GetLastError_2()) _Service_ReportStatus($SERVICE_STOPPED, _WinAPI_GetLastError_2(), 0) Return EndIf $tService_Status_handle = $ret[0] If Not ($tService_Status_handle) Then _Service_ReportStatus($SERVICE_STOPPED, _WinAPI_GetLastError_2(), 0) Return EndIf ;goto cleanup; DllStructSetData($tService_Status, "dwServiceType", $service_type) DllStructSetData($tService_Status, "dwServiceSpecificExitCode", 0); ; report the status to the service control manager. If Not (_Service_ReportStatus($SERVICE_START_PENDING, $NO_ERROR, 3000)) Then ;goto cleanup; _Service_ReportStatus($SERVICE_STOPPED, _WinAPI_GetLastError_2(), 0) logprint("***** & error reporting Service_ReportStatus *******" & @CRLF) _Service_Cleanup() Return EndIf If Not _Service_ReportStatus($SERVICE_RUNNING, $NO_ERROR, 0) Then logprint("Erreur sending running status, exiting") _Service_ReportStatus($SERVICE_STOPPED, _WinAPI_GetLastError_2(), 0) Return EndIf $bServiceRunning = True ; REQUIRED If $bDebug Then logprint("main start") #endregion -- STOP STOP STOP STOP - Don't change anything -- Service Start ; Arcker 02/03/2012 Local $SUBMIT_LAST_REBOOT = True While $bServiceRunning ; REQUIRED ( dont change variable name ) ; there are several ways to find that service have to be stoped - $Running flag in loop is the first method #region --> insert your running code here _CheckReboot() Sleep(10000) #endregion --> insert your running code here WEnd #region -- service stopping _Service_ReportStatus($SERVICE_STOP_PENDING, $NO_ERROR, 1000); If $bDebug Then logprint("main stopped. Cleanup.") #region - STOP STOP STOP Service Stopped, don't change it or you will have stoping status _Service_ReportStatus($SERVICE_STOPPED, $NO_ERROR, 0) ; That all! Our AutoIt Service stops just there! 0 timeout meens "Now" ;~ Exit ;Bug here. In race conditions it's not executed. ProcessClose(@AutoItPID) Return #region - Service Stopped, don't change it or you will have stoping status EndFunc ;==>main If $bDebug Then logprint("script started") If $cmdline[0] > 0 Then Switch $cmdline[1] Case "install", "-i", "/i" ;~ msgbox(0,"","toto") InstallService() Case "remove", "-u", "/u", "uninstall" RemoveService() Case "/msgbox" Exit _MsgBoxExCmd() Case Else ConsoleWrite(" - - - Help - - - " & @CRLF) ConsoleWrite("params : " & @CRLF) ConsoleWrite(" -i : install service" & @CRLF) ConsoleWrite(" -u : remove service" & @CRLF) ConsoleWrite(" - - - - - - - - " & @CRLF) Exit ;start service. EndSwitch Else _Service_init($sServiceName) Exit EndIf ; some loging func Func logprint($text, $nolog = 0) If $nolog Then MsgBox(0, "MyService", $text, 1) Else If Not FileExists($MainLog) Then FileWriteLine($MainLog, "Log created: " & @YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC) FileWriteLine($MainLog, @YEAR & @MON & @MDAY & " " & @HOUR & @MIN & @SEC & " [" & @AutoItPID & "] >> " & $text) EndIf Return 0 ;~ ConsoleWrite($text & @CRLF) EndFunc ;==>logprint Func InstallService() Local $bDebug = True If $bDebug Then ConsoleWrite("InstallService(): Installing service, please wait") If $cmdline[0] > 1 Then $sServiceName = $cmdline[2] EndIf _Service_Create($sServiceName, "Au3Service " & $sServiceName, BitOR($SERVICE_WIN32_OWN_PROCESS, $SERVICE_INTERACTIVE_PROCESS), $SERVICE_AUTO_START, $SERVICE_ERROR_SEVERE, '"' & @ScriptFullPath & '"') If @error Then If $bDebug Then ConsoleWrite("InstallService(): Problem installing service, Error number is " & @error & @CRLF & " message : " & _WinAPI_GetLastErrorMessage()) Else If $bDebug Then ConsoleWrite("InstallService(): Installation of service successful") EndIf Exit EndFunc ;==>InstallService Func RemoveService() _Service_Stop($sServiceName) _Service_Delete($sServiceName) If Not @error Then If $bDebug Then logprint("RemoveService(): service removed successfully" & @CRLF) EndIf Exit EndFunc ;==>RemoveService Func _exit() ;~ if $bDebug then logprint("Exiting") ; Clean opened dll ;~ DllClose($hKernel32_DLL) ;~ DllClose($hAdvapi32_DLL) _Service_ReportStatus($SERVICE_STOPPED, $NO_ERROR, 0); ;~ _service_cleanup("END") ;~ _Service_Cleanup("END") EndFunc ;==>_exit #cs ...from MSDN: The ServiceMain function should perform the following tasks: Initialize all global variables. Call the RegisterServiceCtrlHandler function immediately to register a Handler function to handle control requests for the service. The return value of RegisterServiceCtrlHandler is a service status handle that will be used in calls to notify the SCM of the service status. Perform initialization. If the execution time of the initialization code is expected to be very short (less than one second), initialization can be performed directly in ServiceMain. If the initialization time is expected to be longer than one second, call the SetServiceStatus function, specifying the SERVICE_START_PENDING service state and a wait hint in the SERVICE_STATUS structure. If your service's initialization code performs tasks that are expected to take longer than the initial wait hint value, your code must call the SetServiceStatus function periodically (possibly with a revised wait hint) to indicate that progress is being made. Be sure to call SetServiceStatus only if the initialization is making progress. Otherwise, the Service Control Manager can wait for your service to enter the SERVICE_RUNNING state assuming that your service is making progress and block other services from starting. Do not call SetServiceStatus from a separate thread unless you are sure the thread performing the initialization is truly making progress. When initialization is complete, call SetServiceStatus to set the service state to SERVICE_RUNNING. Perform the service tasks, or, if there are no pending tasks, return control to the caller. Any change in the service state warrants a call to SetServiceStatus to report new status information. If an error occurs while the service is initializing or running, the service should call SetServiceStatus to set the service state to SERVICE_STOP_PENDING if cleanup will be lengthy. After cleanup is complete, call SetServiceStatus to set the service state to SERVICE_STOPPED from the last thread to terminate. Be sure to set the dwServiceSpecificExitCode and dwWin32ExitCode members of the SERVICE_STATUS structure to identify the error. #ce ; emulating your program init() function ;~ Func main_init() ;~ $hGUI = GUICreate("Timers Using CallBack Function(s)") ;~ GUISetState($hGUI,@SW_HIDE) ; unneeded - timers run exelent without guisetstate. ;~ $MainLog = @ScriptDir & "test_service.log" ;~ $sServiceName = "Autoit_Service" ;~ $Running = 1 ;~ if $bDebug then logprint("main_init. Stop event=" & $service_stop_event) ;~ EndFunc ;==>main_init ; stop timer function. its said SCM that service is in the process of $SERVICE_STOP_PENDING ;~ Func myStopTimer($hWnd, $Msg, $iIDTimer, $dwTime) ;~ if $bDebug then logprint("timer = " & $counter) ;~ _Service_ReportStatus($SERVICE_STOP_PENDING, $NO_ERROR, $counter) ;~ $counter += -100 ;~ EndFunc ;==>myStopTimer Func StopTimer() ;~ if $bDebug then logprint("timer = " & $counter) _Service_ReportStatus($SERVICE_STOP_PENDING, $NO_ERROR, $iServiceCounter) $iServiceCounter += -100 EndFunc ;==>StopTimer ; emulate your program main function with while loop (may be gui loop & so on) Func _Stopping() _Service_ReportStatus($SERVICE_STOP_PENDING, $NO_ERROR, 3000) EndFunc ;==>_Stopping Func _CheckReboot() If $REQUIRE_REBOOT = True AND (Not $LAST_REBOOT_PAUSE_TIME OR _Timer_Diff($LAST_REBOOT_PAUSE_TIME) >= 3600000) Then Local $msg = "An application installed and requires a reboot to complete." Local $flag = 48 If $REBOOT_PAUSES_REMAINING > 0 Then $msg &= " Reboot or pause (" & $REBOOT_PAUSES_REMAINING & " remaining)" $flag = 49 EndIf Local $iMsg = _MsgBoxEx($flag, 'System Reboot', $msg, 'Reboot|Pause', 300) If $iMsg = 1 OR $iMsg = -1 Then ;Either "Reboot" was clicked or timeout ran out, so reboot Shutdown(22) Else $LAST_REBOOT_PAUSE_TIME = _Timer_Init() $REBOOT_PAUSES_REMAINING -= 1 EndIf EndIf EndFunc Func _MsgBoxEx($iFlag, $sTitle, $sText, $sCIDChange, $iTimeout = 0) Return RunAsWait($USERNAME, @ComputerName, $PASSWORD, 1, @AutoItExe & ' /msgbox ' & $iFlag & ' "' & $sTitle & '" "' & $sText & '" "' & $sCIDChange & '" ' & $iTimeout, @ScriptDir, @SW_HIDE) EndFunc ;==>_MsgBoxEx Func _MsgBoxExCmd() Local $Static = "Static1" Local $iFlag = $CmdLine[2] Local $sTitle = $CmdLine[3] Local $sText = $CmdLine[4] Local $sCIDChange = StringSplit($CmdLine[5], "|") Local $iTimeout = $CmdLine[6] ;Local $sCIDChange[3] = ['', 'Reboot', 'Pause'] Local $_MsgBox_ If BitAND($iFlag, 16) Or BitAND($iFlag, 32) Or BitAND($iFlag, 48) Or BitAND($iFlag, 64) Then $Static = "Static2" If $iTimeout Then $_MsgBox_ = '"' & "ConsoleWrite(MsgBox(" & $iFlag & ', ""' & $sTitle & '"", ""' & $sText & @LF & @LF & @LF & '"", ' & $iTimeout & '"))' Else $_MsgBox_ = '"' & "ConsoleWrite(MsgBox(" & $iFlag & ', ""' & $sTitle & '"", ""' & $sText & '"", ' & $iTimeout & '"))' EndIf Local $iPID = Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $_MsgBox_, '', @SW_MAXIMIZE, 6) Do Sleep(10) Until WinExists($sTitle) For $iCC = 1 To $sCIDChange[0] ControlSetText($sTitle, '', 'Button' & $iCC, $sCIDChange[$iCC]) Next If $iTimeout Then _CountDown($sTitle, $sText, $iTimeout, $iPID, $Static) Local $iStdOut = StdoutRead($iPID) ; waiting... If Number($iStdOut) Then $returncode = $iStdOut ElseIf IsArray($sCIDChange) Then $returncode = 2 Else $returncode = 1 EndIf Return $returncode EndFunc Func _CountDown($sTitle, $sText, $iTimeout, $iPID, $Static) Local $orig_text = $sText, $now = -999, $now = @SEC ControlSetText($sTitle, "", $Static, $orig_text & @LF & @LF & "This will automatically execute in " & $iTimeout & " second(s)!", 1) While Not Number(StdoutRead($iPID, 2, True)) If $now <> @SEC Then $iTimeout -= 1 $now = @SEC If $iTimeout Then ControlSetText($sTitle, "", $Static, $orig_text & @LF & @LF & "This will automatically execute in " & $iTimeout & " second(s)!", 1) EndIf Sleep(10) WEnd EndFunc ;==>_CountDown
  7. EDIT: Since the issue is a general W7 issue, not anything to do with this UDF, I decided to open new thread
  8. Does this happen to copy open files? If not, is Volume Shadow copy the only way around that? I'm trying to do a custom backup solution, so it needs to be able to copy files even if it's in use.
  9. The mirror doesn't work, and looking at the code, I see why: If Not FileExists($source & "\" & $file) Then If StringInStr(FileGetAttrib($source & "\" & $file), "D") > 0 Then DirRemove($source & "\" & $file, 1) Else FileDelete($source & "\" & $file) EndIf EndIf It checks to see if the file exists on the source, then attempts to delete it from the source if it doesn't (which is both impossible and undesirable). Changing it to the following works better: ;~ mirror option check If GUICtrlRead($yesMirror) == 1 Then $destinationList = _FileListToArrayXT($put, Default, 1, 2, True) For $a = 1 To $destinationList[0] Step 2 $file = StringTrimLeft($destinationList[$a], StringLen($put)) If Not FileExists($source & "\" & $file) Then If StringInStr(FileGetAttrib($destinationList[$a]), "D") > 0 Then DirRemove($destinationList[$a], 1) Else FileDelete($destinationList[$a]) EndIf EndIf Next EndIf ;~ done... As far as doing the date, would a combination of FileGetTime and _DateDiff be a better approach?
  10. Sorry, that probably didn't come accross the way I intended it. I didn't mean it with any degree of contempt. I know how difficult it is to write a UDF from scratch, and I would absolutely be lost without the help of members of this forum. Your script may not fit my needs 100%, but it will get me about 90% of the way there, so there is no reason I couldn't just tweak it to get it the other 10%. I never intended to imply your script was not worthy of use or reference, and I would have to write a new one from scratch. This will be the last post in this particular thread about a _FileListToArray alternative, as it is starting to get off topic (I appologize for that). Just know, I greatly respect your work and efforts, as well as those of everyone.
  11. I know what he meant. I looked at it, in addition to a few other options. His is an acceptable option, I just don't need some of the extra features like sorting. Whether I use his or another one, most likely I'll have to tweak it so the exclude option allows for an entire path (with wildcards), not just an individual file/folder. For example, say I want to exclude C:\temp\test.txt file, but I want to include c:\temp\temp\test.txt. I need to have greater flexibility on how to specify exactly which one I want to exclude. I have not yet found one that will allow that. They only allow me to exclude test.txt, which would exclude it from both those paths. Yes, I suppose I could include an extra check after returning all the files, but it's just another check that should probably be done as it's gathering all the file structure info into the array in the first place.
  12. That's understandable. Yeah, the large number of options is what makes it somewhat to determine which one will work best. Sorting isn't important, nor is limiting the level of recursion (at least in my case). Include/exclude is really the only additional feature I need. It would be nice to find one that has a way of excluding a specific path, not just a filename/directory (meaning I could exclude c:\temp\file.txt, and not just file.txt). I'm guessing I'll have to find one and tweak it to get it to work the way I want. I'll play with a few different options and see what works best.
  13. I'll take a look at that one. There's also option that has similar features. Which is more efficient?
  14. Fair enough. I just didn't know if those things were built in to this UDF. I will make it work.
  15. Sounds good. 1 feature that I would like to see, and I think would qualify this program as more of a true "sync" program is that if the file has been deleted from the source, but exists on the destination, it should be deleted from the destination. Right now, it's more of just a mass-copier program than a sync program.
×
×
  • Create New...