Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: .bat question about where to put a file...  (Read 3560 times)

0 Members and 1 Guest are viewing this topic.

S_R_S5

  • Guest
.bat question about where to put a file...
« on: February 08, 2008, 06:19:15 PM »
When I make a batch file how to I make it copy itself in another folder?
like if i want it to copy itself to my documents.

how would I do this?

Thanks,
S_R_S

Dusty



    Egghead

  • I could if she would, but she won't so I don't.
  • Thanked: 75
  • Experience: Beginner
  • OS: Windows XP
Re: .bat question about where to put a file...
« Reply #1 on: February 09, 2008, 02:41:28 AM »
Your intent is not very clear and why you would want a file to copy itself is questionable but:

Let's assume you have created your .bat file and saved it in the root of C: as Trial.bat

The bat file content would be something like:
:: ================================
@echo off
cls

copy c:\Trial.bat "c:\my documents\"
:: ================================

When you enter c:\Trial.bat the file will be copied to c:\my documents\trial.bat (provided that the folder C:\My Documents exists)

Good luck
One good deed is worth more than a year of good intentions.