Jump to content

dem3tre

Active Members
  • Posts

    25
  • Joined

  • Last visited

  • Days Won

    1

dem3tre last won the day on September 24 2018

dem3tre had the most liked content!

dem3tre's Achievements

Seeker

Seeker (1/7)

5

Reputation

  1. It hasn't been abandoned but other priorities needed to be dealt with. Expect an update in the next day or two with most of the management functions added (at least those that i could readily test). Thanks for the continued interest!
  2. Hmm, thanks for the suggestion but not what I'm looking for, though I do hope to use that function The problem is that I don't have a handle to the window in question and cannot do a simple text search to find it. All I have is the PID of the running process.
  3. Is it possible to determine what window(s) are associated with a given process? Here's my situation - I have a process that kicks off whose title is randomized (don't ask why - it aint my code). The one thing I do have is its PID since the process name doesn't change of course. EDIT: forgot to mention its basically a console application so there aren't any specific controls that i could look for by enumerating all the windows. I'd love to be able to hide this sucker when it pops up. Any ideas? Thanks!
  4. Here is a script you can use to display a dialog to a user and ask them to select a disk while simulatenously showing them the details of those disks. As output, it returns the disk id that can be fed back into diskpart. ;; ;; Function : Ask_TargetDisk ;; Description : Displays a selection GUI containing the current disks available in ;; the system and asks the user to choose one. ;; Parameters : None ;; Returns : Success : diskpart disk number of the selected disk ;; @ERROR : 0 = Success ;; : 1 = Failure ;; @EXTENDED : 0 = Script error ;; 1 = User aborted operation ;; 2 = Diskpart failed in some way, unable to obtain necessary disk information ;; 3 = Diskpart did not report any disks! ;; Requires diskpart.au3 version 0.21 or greater Ask_TargetDisk.au3
  5. If you can stomach using an internal API function you can issue any command you wish to the diskpart console and get the following benefits automatically: If diskpart coredumps/exits you can retrieve its termination code.If the command you send isn't recognized by diskpart, you'll be notified.The output returned is constrained to the current command session only so you don't have to worry about previous command results when parsing the output.Here's the function you should check out: ;; ;; Function : __dpIssueCommand ;; Description : Issues a command to the diskpart interactive console and captures its result. ;; Parameters : $pid : [in] running diskpart process identifier ;; $cmd : [in] command to issue ;; $output : [out] command output ;; Returns : Success : 1 ;; Failure : 0 ;; @ERROR : 0 = Success ;; : 1 = Failure ;; @EXTENDED : 2 = $_DP_ErrorCode_InvalidProcessID ;; : 3 = $_DP_ErrorCode_UnexpectedTermination ;; : 4 = $_DP_ErrorCode_StdoutStreamError ;; : 5 = $_DP_ErrorCode_StdinStreamError ;; : 7 = $_DP_ErrorCode_UnrecognizedCommand ;; Remarks : If @extended = 3 use _DiskpartTerminationCode to retreive its exit code ;;Checkout any of the _Diskpart*** functions to see how its used. I do intend to wrap most diskpart commands to trap errors and simplify getting the results, but it may take a while with my current work schedule. In the mean time, I'll do my best to answer any questions. Thanks !!
  6. Updated the Diskpart Automation API to Version 0.21 Added missing _DiskpartDetailVolume and _DiskpartDetailPartition functions. Updated the demo code to show how you could use the new functions.
  7. Will add the remaining basic disk commands: assign, active, create, clean, delete, and remove tonight. I don't deal much with dynamic disks and the more server centric commands but will add them on request - just let me know which one you need. I'll also add a function that allows you to send raw commands to the console.
  8. Microsoft Diskpart Automation API * UPDATED: 9 January 2007 ** Version 0.21 * Added _DiskpartDetailVolume, _DiskpartDetailPartition, and updated the demo to show their use The structure of the API is fairly stable now and should change little going forward as new functions are added. The following functions are currently available: Process commands: _DiskpartStartConsole......Begin an interactive diskpart session _DiskpartCloseConsole......Terminate an interactive diskpart session _DiskpartTerminationCode...Returns the last recorded diskpart process termination codeFocus commands: _DiskpartSelectDisk.........Sets focus to the given disk _DiskpartSelectVolume.......Sets focus to the given volume _DiskpartSelectPartition....Sets focus to the given partition _DiskpartCurrentDisk........Returns the current in-focus disk _DiskpartCurrentVolume......Returns the current in-focus volume _DiskpartCurrentPartition...Returns the current in-focus partitionInformation commands: _DiskpartListDisks................Lists all fixed disks recognized by diskpart _DiskpartListVolumes..............Lists all volumes (including cd/dvd-rom and removeable) _DiskpartListPartitions...........Lists all partitions for the in-focus disk or volume _DiskpartListPartitionsByDisk.....Sets focus to the given disk and lists its partitions _DiskpartListPartitionsByVolume...Sets focus to the given volume and lists its partitions _DiskpartDetailDisk...............Obtains detailed information for the in-focus disk _DiskpartDetailVolume.............Obtains detailed information for the in-focus volume _DiskpartDetailPartition..........Obtains detailed information for the in-focus partitionManagement commands: TODOHelpful functions: TODO _DiskpartFindDiskByDiskID.........Returns the index of the disk with matching Disk ID (ie., 1CCE2CD3) TODO _DiskpartFindDisksByName..........Returns an array of disks that match the given name (ie., Maxtor OneTouch IIIs USB Device) TODO _DiskpartFindDisksByType..........Returns an array of disks of the given type (ie., USB, IDE)Please see the attached dpdemo.au3 file for an example on how to use this. I've done my best to document the code and make things easy to understand. The dpdemo-output.txt is the console output from the sample as run on my test box.win32.au3 diskpart.au3 dpdemo.au3 dpdemo_output.txt
  9. I added the additional logging and it failed in the same way. This morning I uninstalled all of the AutoIt and SciTE bits from my machine and manually went through to clear out its directories, temp folders, etc again and reinstalled. Now its working as expected and I cannot make it fail. Wish I knew what the problem was but am just glad its gone now and I can move on. Thanks everyone!
  10. Bummer. Even on my home machine its flaky. I thought maybe it could be the mixing of intristic types in the array so I changed: Global $__DP_Version[4] = [ '0.10', 5, 10, '2007/01/03' ]oÝ÷ Ù:ºÚ"µÍÛØ[ ÌÍ××ÑÕÚ[ÛÍHHÈ ÌÎNÌL ÌÎNË ÌÎNÍIÌÎNË ÌÎNÌL ÌÎNË ÌÎNÌ ËÌKÌÉÌÎNÈ but that didn't result in any changes for me. How weird.
  11. I must be missing something fundamental to how AutoIt works as I cannot see why the following code does not work: #include <array.au3> Global Const $__DP_Version[4] = [ '0.10', 1, 10, '2007/01/03' ] Global Enum _; indexes into __DP_Version array $__DP_VersionString = 0, _ $__DP_VersionMajor, _ $__DP_VersionMinor, _ $__DP_VersionDate _ArrayDisplay( $__DP_Version, "__DP_Version" ) ;;; Both of the following tests should generate message boxes, but neither do If $__DP_Version[ $__DP_VersionMajor ] <> 3 Then MsgBox ( 0 , "Major", "not 3" ) If $__DP_Version[ $__DP_VersionMinor ] <> 15 Then MsgBox ( 0 , "Minor", "not 15" )Okay, what really makes this fustrating is that the above code works sometimes meaning I may get the first message box but not the second, or maybe I'll get the second message box but not the first, but most often I get neither. Thinking it was a problem with my development environment I shut everything down, cleaned out the temp folders, rebooted, etc and nope - still have the same problem with inconsistent results, so either I found a bug in AutoIt or I'm missing something in the snippet above. Compiling against AutoIt 3.2.2.0 and AutoItSciTE4 dated 12/31/2006. This is driving me bonkers Thanks ~
  12. The 597 result makes sense now. My sleep deprived brain was thinking the compiler maintained the numeric base when translating between non-string and string; what a mess that would make if it did :"> Another good point. You're right, StringIsXDigit is true to its name. I guess what I was hoping for instead was not a character class test but a StringIsHex() function. How does that square with the documentation then? Which reads: I understand why "0xff" would be false given what's already been said, but why doesn't it realize "ff" can be interpreted as a number? Isn't that its purpose? Bummer. I was hoping I wouldn't have to translate "0x" strings in my files before evaluating them. man I can really be dense sometimes...IsNumber is a type test ala IsString. Thanks for shaking the tree!
  13. Sweet! I was really hoping that was the case. Thanks Dale!
  14. Is its safe to reenter your code after trapping a COM error with a user defined error function? In all of the AutoIt code I've seen so far that catches this condition, they appear to treat it as a fatal error and bail whereas I need to circle back through my code and either try again or take a different path. The docs were not clear on this point for me. An good example of where this would be handy is making WMI calls under WinPE 2.0 can fail the first time through if it takes the system too long to initialize the WMI provider (guessing that is the problem as all subsequent attempts are successful). Thanks!
×
×
  • Create New...