Created
March 16, 2024 04:32
-
-
Save fastfingertips/5747c918783c3343f2c907d76f470b5a to your computer and use it in GitHub Desktop.
This batch script retrieves the path of the desktop folder on a Windows system using PowerShell and then echoes (displays) the path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
SETLOCAL | |
FOR /F "usebackq" %%d IN (`PowerShell -NoProfile -Command "Write-Host([Environment]::GetFolderPath('Desktop'))"`) DO ( | |
SET "DESKTOP_FOLDER_PATH=%%d" | |
) | |
@ECHO Desktop Path: %DESKTOP_FOLDER_PATH% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment