Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: SSHORTCUTS DON'T WORK  (Read 19267 times)

0 Members and 1 Guest are viewing this topic.

ivanoe

    Topic Starter


    Hopeful
    SSHORTCUTS DON'T WORK
    « on: April 28, 2023, 02:20:58 AM »
    Morning .none of my shortcuts work i don't know why they have stopped ,but now i can't get on Google, also i cant download it .
    i get as far as except and install , and then nothing happens.i tried it several times ,nothing. then i went to my downloads and found,
    google set-up exe, there about 6 of them. but when i try to open them nothing.if i try to open as administrator   it just starts the download again.
    i am going round in circles. any advice Please.

    Hackoo



      Hopeful
    • Thanked: 42
    • Experience: Expert
    • OS: Windows 10
    Re: SSHORTCUTS DON'T WORK
    « Reply #1 on: April 28, 2023, 01:46:48 PM »
    What's your Anti-virus ?
    May be you have been infected by a worm ? But I can't confirm that now.  ::)
    I made some tools for scanning the shortcuts and give me their targets in batch and PowerShell.
    Just let me know if you are interesting !

    Hackoo



      Hopeful
    • Thanked: 42
    • Experience: Expert
    • OS: Windows 10
    Re: SSHORTCUTS DON'T WORK
    « Reply #2 on: April 30, 2023, 01:31:19 AM »
    Description of this Hybrid code : Scan4Shortcuts.bat

    This is a script that scans a user-selected folder for shortcut files with suspicious target paths.
    The script is executed as a batch file and PowerShell script hybrid, allowing it to be run by both interpreters.

    When executed, the script prompts the user to select a folder to scan for shortcuts.
    It then searches for all shortcut files in the selected folder and its subfolders that end with the .lnk extension.
    For each shortcut file found, the script extracts the target path and creation date, and concatenates any arguments included in the shortcut.
    It then checks if the target path contains any of the specified suspicious strings.
    If a suspicious string is found in the target path, the shortcut file name, path, target path, and creation date are recorded in a dictionary.

    The script also creates two CSV files:
    one containing all the shortcut files found in the selected folder and its subfolders, and another containing only the shortcut files with suspicious target paths.
    The file paths are stored on the user's desktop.
    If the script finds any shortcut files with suspicious target paths, it opens the suspicious paths CSV file automatically.

    Finally, the script displays the results in a pop-up window using Out-GridView.
    This allows the user to interact with the results, search for specific values, and sort them.
    The user can analyze the results further using the CSV files created by the script.

    Just copy and paste this code into your notepad or notepad++ and save it as
    Scan4Shortcuts.bat
    Code: [Select]
    <# : Batch Script Section
    @rem # The previous line does nothing in Batch, but begins a multiline comment block in PowerShell. This allows a single script to be executed by both interpreters.
    @echo off
    Title Scan For Suspicious Shortcuts Targets On %COMPUTERNAME% by Hackoo 2023 & Mode 80,8
    setlocal
    cd /d "%~dp0"
    Color 1E & echo( & Echo(
    Echo(      Choose a folder to Scan for shortcuts targets On %COMPUTERNAME% ...
    Powershell -executionpolicy bypass -Command "Invoke-Expression $([System.IO.File]::ReadAllText('%~f0'))"
    EndLocal
    goto:eof
    #>
    # Powershell Script Section begin here...
    # Here we execute our powershell commands...
    Clear-Host
    Add-Type -AssemblyName System.Windows.Forms

    $folderBrowser = New-Object System.Windows.Forms.FolderBrowserDialog
    $folderBrowser.RootFolder = [System.Environment+SpecialFolder]::Desktop
    $folderBrowser.Description = "Select a Folder to search for shortcuts on it"
    $folderBrowser.ShowNewFolderButton = $false # Hide "New Folder" button
    if ($folderBrowser.ShowDialog() -eq 'OK') {
        $folderPath = $folderBrowser.SelectedPath
    } else {
        Write-Host "Folder selection cancelled."
        exit
    }
    Write-Host "Please Wait a While ... Scanning is in Progress ..." -ForegroundColor Cyan
    $shortcutFiles = Get-ChildItem -Recurse "$folderPath\*.lnk" -ErrorAction SilentlyContinue
    if (!$shortcutFiles) {
        Write-Host "No shortcut files found in the selected folder."
        exit
    }
    cls
    if ($folderPath.Length -EQ 3) {
        $driveLetter = $folderPath.Substring(0,1)
        $csvPath = "$env:UserProfile\desktop\SuspectPaths_$driveLetter.csv"
        $ALL = "$env:UserProfile\desktop\ALL_Shortcuts_$driveLetter.csv"
    } else {
        $csvPath = "$env:UserProfile\desktop\SuspectPaths_$($folderPath.Split('\')[-1]).csv"
        $ALL = "$env:UserProfile\desktop\ALL_Shortcuts_$($folderPath.Split('\')[-1]).csv"
    }

    $totalFiles = $shortcutFiles.Count
    $currentFile = 0
    $suspectPaths = @{}

    $results = foreach ($shortcutFile in $shortcutFiles) {
        $currentFile++
        $percentComplete = ($currentFile / $totalFiles) * 100
        $percentComplete = [math]::Round($percentComplete)
        $shell = New-Object -ComObject WScript.Shell
        $shortcut = $shell.CreateShortcut($shortcutFile.FullName)
        $targetPath = $shortcut.TargetPath
        $creationDate = $shortcutFile.CreationTime
        $Name = $shortcutFile.Name
        $arguments = $shortcut.Arguments
        if ($arguments -ne $null -and $arguments -ne '') {
            $targetPath = "$targetPath $arguments"
        }

        $statusText = "Processing file $currentFile of $totalFiles    ...    $percentComplete%"
        Write-Progress -Activity "Processing shortcuts" -PercentComplete $percentComplete -Status $statusText

        # Check if the target path contains suspicious strings
        $suspectStrings = @("SKYPEE", "GOOGLEUPDATE.A3X","cmd","powershell","bat","vbs")
        $isSuspect = $false
        foreach ($suspectString in $suspectStrings) {
            if ($targetPath -like "*$suspectString*") {
                $isSuspect = $true
                $suspectPaths[$Name] = @{
                    Path = $targetPath
                    CreationDate = $creationDate
                    ShortcutFile = $shortcutFile.FullName
                }
                break
            }
        }

        [PSCustomObject]@{
            ShortcutName = $Name
            'Shortcut File' = $shortcutFile.FullName
            TargetPath = $targetPath
            'Creation Date' = $creationDate
        }
    }

    if ($suspectPaths.Count -gt 0) {
        $csvData = @()
        foreach ($name in $suspectPaths.Keys) {
            $csvData += [PSCustomObject]@{
                ShortcutName = $name
                ShortcutFile = $suspectPaths[$name].ShortcutFile
                TargetPath = $suspectPaths[$name].Path
                CreationDate = $suspectPaths[$name].CreationDate
            }
        }
        $csvData | Export-Csv -Path $csvPath -NoTypeInformation -Encoding UTF8
    }

    $results | Export-Csv -Path $All -NoTypeInformation -Encoding UTF8
    $results | Out-GridView -Title "Results" -Wait
    If (Test-path $csvPath) {ii $csvPath}