blckpythn Posted August 6, 2012 Share Posted August 6, 2012 (edited) Hey guys, back from the grave here(long time no see) I've got a little utility for many of my clients to see and copy-to-clipboard basic computer information for our ticketing system. In this script I want to include any mapped drives during the ClipPut command. Unfortunately I'm not quite sure how to enumerate and convert to text these drives. I can get them to print to console just fine, but I want to include in the ClipPut function. Here is the jist of it. $drives = DriveGetDrive("NETWORK") If @error Then ConsoleWrite("An error occured while retrieving the drives.") Else For $i = 1 To $drives[0] ConsoleWrite(StringUpper($drives[$i]) & " " & DriveMapGet($drives[$i]) & @CRLF) Next EndIf Func Copy() ClipPut("Drives: " & ) EndFunc ;==>Copy Forgive me if I screwed up the autoit-in-forum tags. So at the 3rd to last line after "Drives: " I want it to show each drive letter and path like the ConsoleWrite command does. Any ideas of how to do this without manhandling an array value repeatedly? I'm assuming there has to be a way to do a For...To loop within the ClipPut parenthesis, yes? Edited August 7, 2012 by blckpythn Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 7, 2012 Share Posted August 7, 2012 After that press CTRL+V Local $drives = DriveGetDrive("NETWORK") Local $tmp If @error Then ConsoleWrite("An error occured while retrieving the drives.") Else For $i = 1 To $drives[0] ;~ ConsoleWrite(StringUpper($drives[$i]) & " " & DriveMapGet($drives[$i]) & @CRLF) $tmp &= StringUpper($drives[$i]) & " " & DriveMapGet($drives[$i]) & @CRLF Next ClipPut($tmp) EndIf Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
blckpythn Posted August 7, 2012 Author Share Posted August 7, 2012 Ah, thank you! That makes so much sense. Link to comment Share on other sites More sharing options...
blckpythn Posted August 7, 2012 Author Share Posted August 7, 2012 Unfortunately I'm now getting a syntax error at the end of the @CRLF, says it's missing Next. If I put Next on the same line then it says my EndFunc is ending the For loop. Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 7, 2012 Share Posted August 7, 2012 Show your code, please. Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
blckpythn Posted August 7, 2012 Author Share Posted August 7, 2012 Show your code, please. $drives = DriveGetDrive("NETWORK") $clipboard = "" For $i = 1 To $drives[0] $clipboard &= StringUpper($drives[$i] & " " & DriveMapGet($drives[$i]) & @CRLF Next $clipboard &= "[/code]" ClipPut($clipboard) Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 7, 2012 Share Posted August 7, 2012 $drives = DriveGetDrive("NETWORK") $clipboard = "" For $i = 1 To $drives[0] $clipboard &= StringUpper($drives[$i]) & " " & DriveMapGet($drives[$i]) & @CRLF Next $clipboard &= "[/code]" ClipPut($clipboard) You forgot to close the ) from StringUpper. Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
blckpythn Posted August 7, 2012 Author Share Posted August 7, 2012 Ha, thank you, I feel stupid. Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 7, 2012 Share Posted August 7, 2012 Little mistake, nothing really stupid. Glad I could help. Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now