vvb Posted August 5, 2009 Share Posted August 5, 2009 Hi All, I've been using AutoIt 3.3.0.0 for just over a week. Very useful. I have the following questions: 1. I've been trying to write a script to manipulate user's permissions in the C:\Documents and Settings folder. I've got the handle to the listview and the index of a user but performing a _GUICtrlListView_ClickItem($h, $idx, "secondary") brings up the general context menu rather than the one for the selected user. I've searched and have come across a post about the column been too wide and have tested it by reducing the size of the name column in explorer. This works. However, according to that post, the bug was fixed in 3.2.13.8 beta. Why is it still present. I managed to fix it by forcing the name column to adopt the header size. Is this the correct way or am I missing something? 2. When attempting to delete all files under a directory (recursively), I used: $filesToDelete = "C:\Documents and Settings\tempUser\Start Menu\*.*" $ret = RunWait(@ComSpec & " /c del /f /s /q" & $filesToDelete, "", @SW_HIDE) The above does not delete any file under the Start Menu folder (I'm logged in as an Admin). Is the above correct way of deleting or do I have to perform recursion my self on every folder under Start Menu and use FileDelete on each folder? All help much appreciated. Cheers Vlad I'll be AutoIting my entire system soon. Link to comment Share on other sites More sharing options...
99ojo Posted August 5, 2009 Share Posted August 5, 2009 Hi All, I've been using AutoIt 3.3.0.0 for just over a week. Very useful. I have the following questions: 1. I've been trying to write a script to manipulate user's permissions in the C:\Documents and Settings folder. I've got the handle to the listview and the index of a user but performing a _GUICtrlListView_ClickItem($h, $idx, "secondary") brings up the general context menu rather than the one for the selected user. I've searched and have come across a post about the column been too wide and have tested it by reducing the size of the name column in explorer. This works. However, according to that post, the bug was fixed in 3.2.13.8 beta. Why is it still present. I managed to fix it by forcing the name column to adopt the header size. Is this the correct way or am I missing something? 2. When attempting to delete all files under a directory (recursively), I used: $filesToDelete = "C:\Documents and Settings\tempUser\Start Menu\*.*" $ret = RunWait(@ComSpec & " /c del /f /s /q" & $filesToDelete, "", @SW_HIDE) The above does not delete any file under the Start Menu folder (I'm logged in as an Admin). Is the above correct way of deleting or do I have to perform recursion my self on every folder under Start Menu and use FileDelete on each folder? All help much appreciated. Cheers Vlad Hi, 1st) _GUICtrlListView_ClickItem($h, $idx, "secondary") try "left" or "right" instead of secondary 2nd) This should work: $filesToDelete = """C:\Documents and Settings\tempUser\Start Menu\*.*""" $ret = RunWait(@ComSpec & " /c del /f /s /q " & $filesToDelete, "", @SW_HIDE) ;-)) Stefan Link to comment Share on other sites More sharing options...
vvb Posted August 5, 2009 Author Share Posted August 5, 2009 Hi,1st)_GUICtrlListView_ClickItem($h, $idx, "secondary") try "left" or "right" instead of secondary2nd)This should work:$filesToDelete = """C:\Documents and Settings\tempUser\Start Menu\*.*"""$ret = RunWait(@ComSpec & " /c del /f /s /q " & $filesToDelete, "", @SW_HIDE);-))Stefan1. I use "Secondary" for right-clicks and "Primary" for left-clicks just in-case a person is left handed and has swapped the buttons around. Either way, both clicks are off.2. The del command when performed on the command prompt works, just not in autoit. I'll be AutoIting my entire system soon. Link to comment Share on other sites More sharing options...
99ojo Posted August 5, 2009 Share Posted August 5, 2009 (edited) Hi,1st) See Help MousClick The "secondary" or "menu" buttons will usually bring up the context menu, whether the buttons are swapped or not. I think this is your problem!2nd) Did you copy my corrected code? I added qoutationmarks for $filestodelete and a blank after the /q in $ret;-)Stefan Edited August 5, 2009 by 99ojo Link to comment Share on other sites More sharing options...
vvb Posted August 5, 2009 Author Share Posted August 5, 2009 Hi,1st) See Help MousClick I think this is your problem!2nd) Did you copy my corrected code? I added qoutationmarks for $filestodelete and a blank after the /q in $ret;-)Stefan1. I'm after the context menu as I want to display the properties dialog for a folder. However, the problem also occurrs for single click selects. This is only on the Explorer. I dont have this problem for any other listviews/2. Thanks for that. Totally missed it. I'll be AutoIting my entire system soon. 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