Sign in to follow this  
Followers 0
Chimaera

Public Folder 7 & 8 Issue

6 posts in this topic

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

post-60350-0-59947600-1370630978_thumb.p

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?

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

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/


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

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)

userbar.png

Share this post


Link to post
Share on other sites

 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

Share this post


Link to post
Share on other sites

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

post-60350-0-54094700-1370762593_thumb.p

Look at the difference between the tabs for the Location and Details.

Its very weird

I cant think of any other solutions atm

Share this post


Link to post
Share on other sites

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.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

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  
Followers 0