Jump to content
Sign in to follow this  
Pook

? Importing into ControlListView ?

Recommended Posts

Pook

Okay,

I've been looking all over the forums for an answer in hopes of avoiding posting. <so not to look like a N00B> But I can find a answer that I can understand. (I'm still getting my feet wet with autoit)

What I'm doing is running this code below. To get the names of the workstations a users has logged into and out off. (this parts works)

$name="JOE_BlOW" 
Run(@ComSpec & " /c dsquery computer -desc *" & $name & "*logoff* -o rdn > C:\TEMP\logoff.txt","",@SW_HIDE) 
Run(@ComSpec & " /c dsquery computer -desc *" & $name & "*logon* -o rdn > C:\TEMP\logon.txt","",@SW_HIDE)

The TXT file looks like this:

"Computer1"
"Computer2"
"Computer3"
"Computer4"

My problem. I'm trying to import the txt file into a Listview. But I only want the top four Computer names, and I can't get it to remove the " around the computer names. Any ideas, or can someone point me to an example I can look at. I can't find anything in the forums, but then again I'm might not be looking in the right place.

Share this post


Link to post
Share on other sites
martin

Okay,

I've been looking all over the forums for an answer in hopes of avoiding posting. <so not to look like a N00B> But I can find a answer that I can understand. (I'm still getting my feet wet with autoit)

What I'm doing is running this code below. To get the names of the workstations a users has logged into and out off. (this parts works)

$name="JOE_BlOW" 
Run(@ComSpec & " /c dsquery computer -desc *" & $name & "*logoff* -o rdn > C:\TEMP\logoff.txt","",@SW_HIDE) 
Run(@ComSpec & " /c dsquery computer -desc *" & $name & "*logon* -o rdn > C:\TEMP\logon.txt","",@SW_HIDE)

The TXT file looks like this:

"Computer1"
"Computer2"
"Computer3"
"Computer4"

My problem. I'm trying to import the txt file into a Listview. But I only want the top four Computer names, and I can't get it to remove the " around the computer names. Any ideas, or can someone point me to an example I can look at. I can't find anything in the forums, but then again I'm might not be looking in the right place.

To get rid of a substring in a string you can use StringReplace, and make the replacement an empty string.

Eg

$NewStr = StringReplace($OldStr,'"',''); '"' = single quote + double quote + single quote, '' = single quote + single quote


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
Pook

Sorry I'm slow, but I'm still don't get listview. I've been reading the posts and reading the notes in GuiListview.au3. And I'm still lost. I can't find any good documentation on how to use all the commands that come with GuiListview_xxxxx. I'm just trying to import a text file into the listview, but I can't understand any of the posts, or documentation.

I'm not looking for a give me... I just need some help pointing me in the right direction.

Share this post


Link to post
Share on other sites
Pook

Nevermind... MY Dumb A$$ I didn't look at the Help File that installed with Autoit. I didn't know that file had all that info in it....

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.