Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Shareware & Freeware

Shareware & Freeware Bertukar informasi mengenai Software berbayar ataupun gratis.

Reply
 
Thread Tools
  #1  
Old 24th October 2012
JagoOnline JagoOnline is offline
Ceriwiser
 
Join Date: Oct 2012
Posts: 768
Rep Power: 14
JagoOnline mempunyai hidup yang Normal
Default [TRIK] Atasi Shortcut Desktop Windows 7 Yang Hilang Misterius

Problem shortcut di desktop yg hilang tanpa jelas apa alasannya kadang ditemui pada pengguna Win7. Dan ini sering disebabkan System Maintenance Windows yg secara rutin memaintenance system termasuk service yg mempengaruhi keberadaan shortcut2 di dekstop dgn cara:



Menghapus shortcut2 di desktop yg sudah tidak berfungsi selama minimal 3 bulan, dan menghapus shortcut2 di desktop yg cacat yg jumlahnya lebih dari 4 biji. Akibatnya, Win7 taunya shortcut itu tidak nyambung ke lokasi network karena cacat dan mengalamatkan link shortcut itu malah ke folder shell.



M$ sendiri sdh menawarkan 2 solusi utk masalah ini:




[/quote]
Quote:





Desktop shortcuts disappear in Windows 7





Cara pertama dgn membatasi jumlah shortcut yg rusak tadi minimal 4 biji tentu kadang tdk mungkin dilakukan menyangkut soal shortcut yg cacat yg disebut diatas.



Sedang, solusi kedua adalah dgn mematikan fungsi/turn-off Computer Maintenance Windows: (Klik Start > Control Panel > Klik "Find and fix problems" di bagian "System and Security" > klik "Change settings" > Set "Computer Maintenance" ke posisi "Off").



Sayangnya, dgn mematikan fitur Computer Maintenance berarti juga mematikan fungsi task2 lain yg mungkin saja tetap agan butuhkan, semisal cek time-system, disk volume error, atau disk space error, dsb..



Dan, untuk itu tujuan trik ini ditujukan,..



Mengatasi Masalah Shortcut Desktop Yang Hilang Tanpa Perlu Mematikan Fitur Computer Maintenance

  1. Cara Manual:
    1. Download dan eksekusi/merge file registry tweak ini buat menambah menu-konteks di explorer "Take Ownership":




    1. Quote:
    2. Masuk ke folder:




    3. [quote]





      C:\WINDOWS\Diagnostics\Scheduled\Maintenance





      dan klik kanan file TS_BrokenShortcuts.ps1. Pilih opsi "Take Ownership" yg ada di menu-konteks explorer.
    4. Klik "Start > All Programs > Accessories". Klik kanan link "Command Prompt" dan pilih "Run As Administrator". Terus ketik ini di cmd-prompt:




      Code:

      icacls c:\windows\diagnostics\scheduled\maintenance\TS_Br okenShortcuts.ps1 /grant User_Name_Agan:F

      (**Ganti baris "User_Name_Agan" dgn username agan**)
    5. Buka file "TS_BrokenShortcuts.ps1" dgn Notepad (disarankan Notepad++) terus cari baris ini (baris#11):




      Code:

      [string]$list = ""

    6. Hapus semua baris2 ini yg ada bawahnya (baris#12 s/d 22):




      [/spoiler]
      Spoiler for open this:
      Spoiler for open this:
      for :




      Get-ChildItem -Path $path -filter *.lnk | Foreach-Object {

      $fullPath = ConvertTo-WQLPath $_.FullName

      $wmiLinkFile = Get-WmiObject -query "SELECT Name,Target,AccessMask FROM Win32_ShortcutFile WHERE Name = '$fullPath'"



      if(-not(Test-ValidLink $wmiLinkFile) -and (Test-Delete $wmiLinkFile))

      {

      $list = AttachTo-List $list $wmiLinkFile.Name

      }

      }






    7. Masih dlm file yg sama, cari baris ini (baris#24):




      Code:

      [string]$list = ""

      Hapus baris2 ini yg ada dibawahnya (baris no. 25 s/d 35):




Spoiler for open this:
Spoiler for open this:
for :




Get-ChildItem -Path $path -filter *.lnk | Foreach-Object {

$fullPath = ConvertTo-WQLPath $_.FullName

$wmiLinkFile = Get-WmiObject -query "SELECT Name,Target,AccessMask FROM Win32_ShortcutFile WHERE Name = '$fullPath'"

$lastAccessTime = Get-LastAccessTime $_.FullName



if((Test-ValidLink $wmiLinkFile) -and (Test-Delete $wmiLinkFile) -and (Test-FileShortcut $wmiLinkFile) -and (Test-Unused $lastAccessTime $threshold))

{

$list = AttachTo-List $list $wmiLinkFile.Name

}

}










Spoiler for open this:
  • Save dan tutup notepad.
  • Spoiler for open this:
    Spoiler for open this:


    NB. Jangan lupa backup file-nya sebelum agan edit.



    _____________________



    ATAU, klo agan tdk terlalu suka repot, cukup agan cari saja baris substring -gt 4 dlm file "TS_BrokenShortcuts.ps1". Ganti angka "4"-nya jadi 10, 20, dsb atau berapa saja angka diatas angka "4".....
  • Via Script:



    Save baris2 ini dlm notepad kosong, save dgn nama file apa saja yg penting ekstensinya ".vbs":




  • [spoiler=open this] for :








    set wshShell = CreateObject("WScript.Shell")

    Set objFSO = CreateObject("Scripting.FileSystemObject")



    function patchFile(filePath, fileName, reqdSize, findLine, replaceWith)

    dim tmpFilename, curLine



    If objFSO.FileExists(filepath&filename) True Then

    exit function

    End If



    If objFSO.GetFile(filepath&filename).Size reqdSize Then

    exit function

    End If



    uacCheck()



    wshShell.Run "takeown /f "&filepath, 0, true

    wshShell.Run "takeown /f "&filepath&filename, 0, true

    wshShell.Run "icacls "&filepath&" /grant %nama_user_agan%:F", 0, true

    wshShell.Run "icacls "&filepath&filename&" /grant %nama_user_agan%:F", 0, true



    Set myFile = objFSO.OpenTextFile(filepath&filename, 1, True)

    Set myTemp= objFSO.OpenTextFile(filepath&filename&".patch", 2, True)



    curLine = 0

    Do While Not myFile.AtEndofStream

    curLine = curLine+1

    If curLine findline Then

    myTemp.WriteLine myfile.ReadLine



    Else

    myFile.Skipline

    myTemp.WriteLine replaceWith

    End If

    Loop



    myFile.Close

    myTemp.Close





    tmpFilename = filepath&filename&"."&Replace(Replace(Now, ":", "."), "/", "-")&".orginal"

    objFSO.MoveFile filepath&filename, tmpFilename



    objFSO.MoveFile filepath&filename&".patch", filepath&filename



    wshShell.Run "icacls "&filepath&" /setowner ""nt service\trustedinstaller""", 0, true

    wshShell.Run "icacls "&filepath&filename&" /setowner ""nt service\trustedinstaller""", 0, true

    wshShell.Run "icacls "&tempFilename&" /setowner ""nt service\trustedinstaller""", 0, true

    wshShell.Run "icacls "&tempFilename&" /remove:g %nama_user_agan%", 0, true

    wshShell.Run "icacls "&filepath&filename&" /remove:g %nama_user_agan%", 0, true

    wshShell.Run "icacls "&filepath&" /remove:g %nama_user_agan%", 0, true



    end function

    call main

    '

    sub main

    patchFile wshShell.ExpandEnvironmentStrings("%windir%")&"\di agnostics\scheduled\Maintenance\", "TS_BrokenShortcuts.ps1", 2724, 22, " return """" #removed $list to cancel out script"

    patchFile wshShell.ExpandEnvironmentStrings("%windir%")&"\di agnostics\scheduled\Maintenance\", "TS_UnusedDesktopIcons.ps1", 2567, 36, " return """" #removed $list to cancel out script"

    end sub

    function uacCheck()

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonat e}!\\" & strComputer & "\root\cimv2")

    Set colOperatingSystems = objWMIService.ExecQuery _

    ("Pilih Caption dari Win32_OperatingSystem dimana Caption seperti '%Vista%' atau Caption seperti '%2008%' atau Caption seperti '%Windows 7%'")

    For Each objOperatingSystem in colOperatingSystems

    If WScript.Arguments.length =0 Then

    Set objShelluac = CreateObject("Shell.Application")

    objShelluac.ShellExecute "wscript.exe", Chr(34) & WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1

    wscript.quit

    End If

    next

    ''

    end function













    (**Sesuaikan baris %nama_user_agan% yg ane tebalin merah dgn username agan**)



    SELESAI!




    Reply With Quote
    Reply


    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off


     


    All times are GMT +7. The time now is 06:12 AM.


    no new posts