Page 1 of 1

set CD (current directory) to permanent as desktop

Posted: 02 Apr 2010 06:21
by jamesfui
hi everyone!
is it possible to set the CD (current directory) as permanent desktop?
for example,
@echo off
CD "c:\....\destop\"
copy *.txt "d:\destination\"

from the above, how do i set the current directory as always to the desktop
EVEN if i save this bat to others people pc?

thanks :D

Re: set CD (current directory) to permanent as desktop

Posted: 02 Apr 2010 07:38
by !k

Code: Select all

@echo off
cd /d %USERPROFILE%\Desktop
copy *.txt "d:\destination"

Re: set CD (current directory) to permanent as desktop

Posted: 03 Apr 2010 05:41
by jamesfui
it works very well..
it is way better than i manually search for my full path of every pc desktop!!

thanks :o :D