set CD (current directory) to permanent as desktop

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
jamesfui
Posts: 50
Joined: 27 Mar 2010 23:00

set CD (current directory) to permanent as desktop

#1 Post by jamesfui » 02 Apr 2010 06:21

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

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

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

#2 Post by !k » 02 Apr 2010 07:38

Code: Select all

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

jamesfui
Posts: 50
Joined: 27 Mar 2010 23:00

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

#3 Post by jamesfui » 03 Apr 2010 05:41

it works very well..
it is way better than i manually search for my full path of every pc desktop!!

thanks :o :D

Post Reply