What’s the environment variable for the path to the desktop?

To be safe, you should use the proper APIs in Powershell (or VBScript)
Using PowerShell:

[Environment]::GetFolderPath("Desktop")

Copy something using Powershell:

Copy-Item $home\*.txt ([Environment]::GetFolderPath("Desktop"))

Here is a VBScript-example to get the desktop path:

dim WSHShell, desktop, pathstring, objFSO
set objFSO=CreateObject("Scripting.FileSystemObject")
Set WSHshell = CreateObject("WScript.Shell")
desktop = WSHShell.SpecialFolders("Desktop")
pathstring = objFSO.GetAbsolutePathName(desktop)
WScript.Echo pathstring

Leave a Comment