Computing.Net > Forums > Disk Operating System > Batch to Find the Desktop path

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Batch to Find the Desktop path

Reply to Message Icon

Original Message
Name: Benze
Date: August 8, 2003 at 08:30:55 Pacific
Subject: Batch to Find the Desktop path
OS: windows XP
CPU/Ram: P4 1.7GHz
Comment:

I want write a batch file to copy a shortcut to the desktop. But with all the windows OS out there and the networks, how can I find the path for the Desktop.

I tried with C:..\Desktop, but in only work if I run the batch file from the desktop.

HELLLLLLLLLLLLLLLLLLPPPPPPP!!!!!

Thanks


Report Offensive Message For Removal


Response Number 1
Name: whoeva
Date: August 8, 2003 at 16:48:19 Pacific
Reply: (edit)

@echo off
copy "location of shortcut" "C:\Documents and Settings\Owner\Desktop"


Report Offensive Follow Up For Removal

Response Number 2
Name: bitbyte
Date: August 9, 2003 at 09:52:53 Pacific
Reply: (edit)


---------------------
save following line to scopy.bat
@copy %USERPROFILE%\Desktop\%1 %2
thats all

example to copy shortcut cut1.lnk to c:\temp

scopy.bat cut1.lnk c:\temp



Report Offensive Follow Up For Removal

Response Number 3
Name: bitbyte
Date: August 9, 2003 at 10:00:04 Pacific
Reply: (edit)


oh sorry i read FROM THE DESKTOP but its TO THE DESKTOP

following is correct
@copy %1 %USERPROFILE%\Desktop\%2

save as scopy.bat

1st parameter is the file to copy, 2nd can be used to give it another name


Report Offensive Follow Up For Removal

Response Number 4
Name: wizard-fred
Date: August 9, 2003 at 21:04:18 Pacific
Reply: (edit)

This assumes that the Desktop is on the same drive as the install directory.

I frequently move by Desktop to another drive if I am using it to save to.


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History




Data Recovery Software