Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-2024-07-18· OpenAIAi2 WildChat-4.8M (AI2)

powershell -Command ^ "$WshShell = New-Object -ComObject WScript.Shell; ^ $desktopPath =…

  1. User

    powershell -Command ^ "WshShell = New-Object -ComObject WScript.Shell; ^ desktopPath = [System.Environment]::GetFolderPath('Desktop'); ^ Shortcut=Shortcut = WshShell.CreateShortcut("desktopPath\\Discord.lnk\"); ^ Shortcut.TargetPath = "%DISCORD_PATH%"; ^ $Shortcut.Save()"

    echo. echo Discord Debloat Completed. echo. pause

  2. Assistant

    It looks like you have a PowerShell command script that creates a shortcut for Discord on the desktop. If you want to clarify or improve it, below is a more organized explanation along with a complete script, including setting the %DISCORD_PATH% environment variable. Make sure to replace C:\Path\To\Discord.exe with the actual path to the Discord executable on your system.

    Here’s a complete PowerShell script including the variables and environments for creating the shortcut:

    # Define the path to the Discord executable
    $DISCORD_PATH = "C:\Path\To\Discord.exe"
    
    # Create a WScript.Shell COM object
    $WshShell = New-Object -ComObject WScript.Shell
    
    # Get the desktop path
    $desktopPath = [System.Environment]::GetFolderPath('Desktop')
    
    # Create the shortcut
    $Shortcut = $WshShell.CreateShortcut("$desktopPath\Discord.lnk")
    $Shortcut.TargetPath = $DISCORD_PATH
    
    # Save the shortcut
    $Shortcut.Save()
    
    # Output confirmation
    echo "Discord Debloat Completed."
    pause
    

    Steps to Execute:

    1. Open a text editor like Notepad.
    2. Copy and paste the script above into the text editor.
    3. Save the file with a .ps1 extension (for example, CreateDiscordShortcut.ps1).
    4. Make sure to adjust the path for DISCORD_PATH to point to where Discord is installed on your system.
    5. Run PowerShell as an administrator and execute the script by navigating to where you saved it and typing .\CreateDiscordShortcut.ps1.

    Note:

    • If your execution policy doesn't allow running scripts, you might need to change it using the command Set-ExecutionPolicy RemoteSigned in PowerShell as an administrator.
    • Ensure that the path does not contain invalid characters and points to the correct executable.

    This script creates a desktop shortcut for Discord based on the provided executable path. It informs the user once the process is completed and waits for a key press before closing, allowing you to see the confirmation message.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.