Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/15/2014 in all areas

  1. Hi Carm01, I see some issues with your code. The FileOpen in the loop which creates a file write handle 26 times and yet not any of those handles used once or closed at the end of use. I would expect the file write handle to be opened before entering the loop or perhaps when the loop is done. The later would mean storing the commands in a variable while looping. Using _FileCreate() seems a waste, especially including <file.au3>, as FileOpen or FileWrite used by itself creates the file anyhow. Instead of going from a to z and using those functions in the loop 26 times, I would recommend DriveGetDrive to get the network drives then it would probably be just a couple of loops depending on the mapped drive count. Here is an alternative example ; cmd script to write net use commands $cmdfile = 'MapDrive.cmd' ; get network drives and store into an array $network_drives = DriveGetDrive('NETWORK') ; check that the array is valid If Not IsArray($network_drives) Then MsgBox(0x40030, @ScriptName, 'No network drives found') Exit 1 Else ; open a handle to write to file using erase mode $handle_write = FileOpen($cmdfile, 2) ; check that the handle is valid If $handle_write = -1 Then MsgBox(0x40030, @ScriptName, 'Unable to open cmd file for write') Exit 2 Else ; loop through each network drive For $1 = 1 To UBound($network_drives) -1 ; get the unc path of the network drive $network_path = DriveMapGet($network_drives[$1]) ; do not write to file if an error occurred If @error Then ContinueLoop ; write net use command to the cmd script FileWrite($handle_write, 'net use ' & $network_drives[$1] & ' "' & $network_path & '"' & @CRLF) Next ; close the file handle that was used for writing FileClose($handle_write) EndIf EndIf Perhaps some ideas which you can use to update your code.
    2 points
  2. One of them - if not the best - is PDFtk.
    1 point
  3. Melba23

    Get Memory Adress

    TrickyDeath, The rules here are simple to understand and apply - and discussion of game bots is one of those things that are not permitted. As a result, arguments as to whether AutoIt is suitable for such things are entirely moot, so please refrain from posting any more of them. M23
    1 point
  4. mohan93, Your code is correct except for this $Replace = "<value>" & @AppDataDir & "\Fluke\SmartView\3.2.639.0\DefaultUserSettings.xml</value>;" Edit I'm running XP so not sure about the 'roaming'
    1 point
  5. @compact21 : Here is Windows API List from MSDN. A tutorial by monoceres : '?do=embed' frameborder='0' data-embedContent>>
    1 point
  6. jguinch

    wingetstate question

    I edited my post. Look at the last line
    1 point
  7. jchd

    Unicode decoding

    It's initial BOM + Unicode (UTF-8 by default) + Unicode escapes in UTF16 and 2-character escapes similar to those in C. A backslash would be u005C or . It's a real mess where "extensions" are allowed, probably to increase the odds of non-interoperability and hidden bugs. It's no wonder since JSON means JavaScript Object Notation. They even pooped an RFC.
    1 point
×
×
  • Create New...