C:\\Documents and Settings\\Administrator\\Desktop
I don\'t want to type the above each time to refer to a file on the desktop
The hybrid of Anders can be a bit more simple and readable, with the method described here hybrid scripting by Tom Lavedas.
@if (@X)==(@Y) @goto :Dummy @end/* Batch part
@echo off
SETLOCAL ENABLEEXTENSIONS
for /f "delims=" %%x in ('cscript //E:JScript //nologo "%~f0"') do set desk=%%x
echo desktop path is %desk%
goto :EOF
***** Now JScript begins *****/
WScript.Echo(WScript.CreateObject("Shell.Application").Namespace(16).Self.Path);