AidanProsser Posted June 15, 2014 Posted June 15, 2014 (edited) ok.. so im making a simple script to highlight everything on the desktop and then delete it.. (send to recycle bin).. to do this im using MouseClickDrag from one corner of the screen to the other, which works, and then sends "Delete" .. to send to the recycle bin. The highlighting of all my desktop icons works, however it also highlights the Recycle Bin.. and when this is selected you cannot delete the files on the desktop. I was wondering how to select all icons on the desktop, then DEselect the recycle bin, then send "Delete". #requireadmin $x = @DesktopWidth $y = @desktopheight blockinput() winminimizeall() Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("HAHAHA, i just hacked ur PC, u moron - Love Aidan.... Program Termination in : ") For $i = 5 to 1 step -1 Send($i & @crlf) Send("{TAB 8}") Sleep(1000) Next WinClose("Untitled - Notepad") WinWaitActive("Notepad","Save") Send("!n") winminimizeall() mouseclickdrag("left",$x - 15,$y * 0.95,10,10,5) send("{DELETE}") sleep(300) send("{ENTER}") sleep(500) filerecycleempty() sleep(200) shutdown() I assure you, this may look like a potentially hazardous script to whoever may use it.. but this is for my own learning experience and entertainment.. (will be using on an old laptop to see what i can make it do ) Edited June 15, 2014 by AidanProsser
BrewManNH Posted June 15, 2014 Posted June 15, 2014 You do realize that there's a desktop folder in the user's profile folder right? You can delete the files from there a LOT easier than manipulating the mouse over the desktop. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
AidanProsser Posted June 15, 2014 Author Posted June 15, 2014 Hmm, yes but i would still have to select all the desktop icons in the user profile folder, and i am still too inexperienced to work out how to deselect the recycle bin (as i said before if the recycle bin is selected along with the other items on the desktop to delete, you are unable to delete the items).
BrewManNH Posted June 15, 2014 Posted June 15, 2014 There are no icons in a folder, there's only files. There's no link to the recycle bin in the Desktop folder. You should open Windows explorer and go to your C:Users<your user name>Desktop folder and see what's in there. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
AidanProsser Posted June 15, 2014 Author Posted June 15, 2014 Im looking in my desktop folder and i can see the recycle bin in there
BrewManNH Posted June 16, 2014 Posted June 16, 2014 There isn't one in any of the computers that I have access to at this time, and that's 2 with Win7 and one Vista machine. If you have a recycle bin in your desktop folder, it's probably a shortcut and not the actual recycle bin, which is on the root of every drive, in a folder called $Recycle Bin or Recycler. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
AidanProsser Posted June 16, 2014 Author Posted June 16, 2014 OHH.. you are 100% correct, my fault.. was looking at the wrong directory.. thank you so much
AidanProsser Posted June 16, 2014 Author Posted June 16, 2014 (edited) One last thing, how would I open the C:Users<your user name>Desktop folder using AutoIt? ... Granted that the username could be unknown to me.. say that I then used the program on a different computer with a different username.. I would want it to still work. Edited June 16, 2014 by AidanProsser
KaFu Posted June 16, 2014 Posted June 16, 2014 ShellExecute(@DesktopDir) OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
AidanProsser Posted June 16, 2014 Author Posted June 16, 2014 Nah, ShellExecute(@DesktopDir) takes me to the computer desktop rather than the user desktop... if that makes sense.. I found ShellExecute(@UserProfileDir) and that took me to the user profile.. now i need to select the desktop icon located in the user profile.. below is a link to the image - http://imgur.com/oU9Ld25 Any ideas on how to do this?
AidanProsser Posted June 16, 2014 Author Posted June 16, 2014 (edited) ^ does not work, code runs but my desktop icons are still there Edited June 16, 2014 by AidanProsser
BrewManNH Posted June 16, 2014 Posted June 16, 2014 Are you sure they're in YOUR desktop and not in the AllUsers desktop? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
AidanProsser Posted June 16, 2014 Author Posted June 16, 2014 when i tested ShellExecute(@UserProfileDir&"\Desktop") it took me to the AllUsers desktop .. i then proceeded with FileDelete(@UserProfileDir&"\Desktop") .. i noticed only a few icons were deleted.
AidanProsser Posted June 16, 2014 Author Posted June 16, 2014 (edited) To be honest, wouldn't it be a lot easier if somone could tell me how to highlight all icons on the desktop.. then control click the recycle bin to deselect it.. then delete? Just I do not know any of the Control ID / Title to use Edited June 16, 2014 by AidanProsser
Developers Jos Posted June 16, 2014 Developers Posted June 16, 2014 To be honest, wouldn't it be a lot easier if somone could tell me how to highlight all icons on the desktop.. then control click the recycle bin to deselect it.. then delete? Just I do not know any of the Control ID / Title to use I honestly fail to see the use of this other that shooting yourself in the foot. So what is really your goal here as this all sounds quite vague to me? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
AidanProsser Posted June 16, 2014 Author Posted June 16, 2014 (edited) Basically im trying to see what i can do to my old laptop (this is what is next to my main computer).. To see, for example what if i could lock myself out from user input, send a troll message to myself via notepad, close notepad without saving, highlight everything on the desktop, delete it and then shut down the computer. It's just a personal mini system screwer that i thought would be fun to make for a laptop i no longer use.. But am encountering problems in trying to delete the icons on the desktop. As fir my goal.. There really isnt one other for my own entertainment and to help familiarise myself with scripting. Edited June 16, 2014 by AidanProsser
Developers Jos Posted June 16, 2014 Developers Posted June 16, 2014 (edited) Basically im trying to see what i can do to my old laptop (this is what is next to my main computer).. To see, for example what if i could lock myself out from user input, send a troll message to myself via notepad, close notepad without saving, highlight everything on the desktop, delete it and then shut down the computer. It's just a personal mini system screwer that i thought would be fun to make for a laptop i no longer use.. But am encountering problems in trying to delete the icons on the desktop. As fir my goal.. There really isnt one other for my own entertainment and to help familiarise myself with scripting. Understood and let's not develop that in your forums through the questions you ask here, as we are quite against any form of prank scripts let alone when they border against the fact they become a virus. -click- Jos Edited June 16, 2014 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts