Chimaera Posted June 7, 2013 Share Posted June 7, 2013 Hi all I have a script that removes unnecessary icons from desktops which are to go on sale so they are as clean as possible. But i have an issue with certain icons that reside in the public folder on Win 7 & 8 Local $sPublic = StringLeft(@UserProfileDir, 8), $sPublic2 $sPublic = $sPublic & "\Public\Desktop" Local $sIconString = "2XL Games Launcher|Acer Backup Manager|Acer Registration" ; Array is bigger but you get the idea $sIconString &= "|Browser Choice|BT Broadband Desktop Help" Local $aIconArray = StringSplit($sIconString, "|") #forceref $aIconArray Local $aIconList = "" $aIconList = $aIconArray For $i = 0 To UBound($aIconList) - 1 ; adds .lnk extension to all array items $aIconList[$i] &= ".lnk" Next ;~ _ArrayDisplay( $aIconList) For $i = 1 To $aIconList[0] If @error = 0 Then FileDelete(@DesktopCommonDir & "\" & $aIconList[$i]) FileDelete(@DesktopDir & "\" & $aIconList[$i]) FileDelete($sPublic & "\" & $aIconList[$i]) Sleep(50) EndIf Next The problem lies with the folder itself, if you check a shortcut it states the address is C:UsersPublicDesktop but if you navigate to the folder I have tried adding the extra like so $sPublic & "\Public\Public Desktop" But i cant seem to get it to delete the shortcuts in that folder. I dont think its a permissions issue as i can delete them normally Any thoughts? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
iamtheky Posted June 7, 2013 Share Posted June 7, 2013 (edited) The folder is c:UserspublicDesktop. And your script works fine on my box (Win7 x86). I did notice that you are adding .lnk to the 0 element in $aIconList, then using that element as the max number in your count for the filedelete loop. *but that did not have an effect on the desired outcome. Edited June 7, 2013 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
TheSaint Posted June 7, 2013 Share Posted June 7, 2013 If problems remain, try the CLSID List, which is mentioned in the Help file, but may be incomplete. It came from - http://www.winguides.com/registry/display.php/61/ Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
Chimaera Posted June 8, 2013 Author Share Posted June 8, 2013 I did notice that you are adding .lnk to the 0 element in $aIconList, then using that element as the max number in your count for the filedelete loop. *but that did not have an effect on the desired outcome. Does it matter? I just created the array like that because i have 2 diff types of files to remove so i change the ending for all of them before i remove them If problems remain, try the CLSID List, which is mentioned in the Help file, but may be incomplete. It came from - http://www.winguides.com/registry/display.php/61/ Thx ill test that today A more extensive list here http://www.sevenforums.com/tutorials/110919-clsid-key-list-windows-7-a.html If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
Chimaera Posted June 9, 2013 Author Share Posted June 9, 2013 Tried with the CLSID and still no go and i tried the Desktop & Public Desktop options after the CLSID The shortcut has a "N" attribute so its not that, the script has require admin permissions already because i know some in their are protected because its part of All Users Look at the difference between the tabs for the Location and Details. Its very weird I cant think of any other solutions atm If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
guinness Posted June 9, 2013 Share Posted June 9, 2013 Here >> http://msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx #include <APIConstants.au3> #include <WinAPIEx.au3> MsgBox($MB_SYSTEMMODAL, '', _WinAPI_ShellGetKnownFolderPath($FOLDERID_PublicDesktop)) You will need WinAPIEx. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 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