阻止升级在 Windows 7 Home 上安装快捷方式

pil*_*row 5 desktop windows-7 shortcuts

可能的重复:
你能阻止安装程序制作桌面快捷方式吗?

如何防止安装程序和升级程序将快捷方式放入Public DesktopWindows 7 主页?

每次我更新iTunesfirefoxacroreadflashgimp任何需要的频繁更新时,更新都会通过在C:\Users\Public\Desktop.

我不记得在 XP 下有这种行为。相反,大多数安装程序会提供是否添加桌面图标的选项。但是,到目前为止,我还没有在 Windows 7 下获得这样的选择。我是否遗漏了什么?

小智 1

我使用一点 VB 脚本将图标移动到每个用户的桌面而不是公共桌面。我确信有更好的方法来获取每个用户的姓名,但我只是对其进行了硬编码。它仍然会在每个用户的个人资料上放置图标,但至少每个人都可以选择是否拥有它。

将以下内容复制到记事本中并作为“.vbs”文件保存到桌面。更改用户以匹配计算机的用户。并将“dim User(4)”行更改为您拥有的用户数。如果您将自己设置为用户(1),它将在复制图标后打开您的桌面文件夹,以便您可以删除任何您不需要的图标。当您有新图标时,只需双击它,它们就会被移出“公共”文件夹。

Dim ObjFso
Dim StrSourceLocation
Dim StrDestinationLocation
Dim StrSourceFileName
Dim StrDestinationFileName
dim objFileCopy
dim file
dim Users(4)
dim i
Dim SH, txtFolderToOpen 

StrSourceLocation = "C:\Users\Public\Desktop"
Users(1) = "Brian"
Users(2) = "Danny"
Users(3) = "Cory"
Users(4) = "Jess"

on error Resume Next

for i = 1 to 4

    StrDestinationLocation = "C:\Users\" & Users(i) & "\Desktop"

    'All text files will be copied to destination
    StrSourceFileName = "*.*"

    'Creating the file system object
    Set ObjFso = CreateObject("Scripting.FileSystemObject")

    'Copying the file
    ObjFso.CopyFile StrSourceLocation & "\" & StrSourceFileName, StrDestinationLocation & "\" , True
    if err.Number <> 0 then
        Msgbox "No files to move"
        WScript.Quit
    end if
Next

Set ObjFso = CreateObject("Scripting.FileSystemObject")
For Each file In ObjFso.GetFolder(StrSourceLocation).Files
    file.delete
Next

Set SH = WScript.CreateObject("Shell.Application") 
txtFolderToOpen = "C:\Users\" & users(1) & "\Desktop"
SH.Explore txtFolderToOpen 
Set SH = Nothing 
Run Code Online (Sandbox Code Playgroud)