Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

batch file help


  • Please log in to reply

#1
pr0n

pr0n

    Member

  • Member
  • PipPipPip
  • 114 posts
I posted this once before (yesterday in the wind XP section) but the post has completely disappeared I dunno if it was deleted or what.

anywho I have my diagnostix machine (my main machine that never moves/changes) then I have 10 workstations on which I have computers coming and going every day. nearly everyone of these workstations needs to pull files from my diag machine so normally I just do the \\diagnostix\c$ in the run command with simple file sharing turned off and navigate my way to the files I want. I would liek to streamline this process since I pull the same files nearly every time. so I wrote a batch file to do it
here's what I have so far

xcopy "%cd%\nero 7 install" "%USERPROFILE%\desktop\nero 7 install" /e /i /h
xcopy "%cd%\office2003" "%USERPROFILE%\desktop\office" /e /i /h
xcopy "%cd%\oem editor" "%USERPROFILE%\desktop\oem editor" /e /i /h
xcopy "%cd%\avg free.exe" "%USERPROFILE%\desktop\"
xcopy "%cd%\dd200.exe" "%USERPROFILE%\desktop\"
xcopy "%cd%\firefox.exe" "%USERPROFILE%\desktop\"
xcopy "%cd%\ncleaner.exe" "%USERPROFILE%\desktop\"
xcopy "%cd%\spybotsd160.exe" "%USERPROFILE%\desktop\"
xcopy "%cd%\spywareblastersetup41.exe" "%USERPROFILE%\desktop\"
pause

when the batch file is ran from the diagnostix machine everything works fine and the files go straight to the desktop. however when ran from one of the work stations the %cd% is changed to the local c:\windows\ and I cannot figure out how to fix that. any ideas?

Edited by pr0n, 11 October 2008 - 02:21 PM.

  • 0

Advertisements


#2
Artellos

Artellos

    Tech Secretary

  • Global Moderator
  • 3,888 posts
Hello there,

What is %cd% supposed to refer to? The CD Drive?

Just to sum it up for my knowing.
You want to copy files from your diagnostics 'server' to the workstations?
So this needs to be dynamic and you want to do it through running a batch?

Regards,
Olrik
  • 0

#3
pr0n

pr0n

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 114 posts
%cd% means current directory so whatever directory the batch is ran from that's what will be put there. so if I have the batch in c:\windows\ %cd%=c:\windows\ likewise if the batch is on the dsektop it would be c:\docs and setts\user\desktop\ the problem is when I run it from a remote computer it doesn't do \\diagnostix\c$ instead it defaults to local computer c:\windows> yeah normally I have to go through a mess of files and select anywere from 10 to 30 different files each time I work on a computer and move them. it would be nice if I had an automated process for the more popular sets that I move
  • 0

#4
Artellos

Artellos

    Tech Secretary

  • Global Moderator
  • 3,888 posts
You can use the MAP command to open network drives. Use the map command to open a drive to your server, then you can let your batch file run from there.

If you need an example (or the actual complete batch), just ask.

Regards,
Olrik
  • 0

#5
pr0n

pr0n

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 114 posts
yeah you could give an example that would be great.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP