Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Public Folder 7 & 8 Issue

$
0
0

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

AutoIt         
    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:\Users\Public\Desktop

but if you navigate to the folder

Capture.PNG

 

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?


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>