Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Pasting A File Into Multiple Locations


  • Please log in to reply
4 replies to this topic

#1 amykt

amykt

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:10:53 AM

Posted 25 October 2005 - 10:02 PM

Hi - every week i need to paste the same file (that gets updated weekly) into about 10 different locations on my computer. Is there some sort of way that I can make a list and it will paste it to all these locations without me having to paste it there individually. Any help would be appreciated :thumbsup: Thanks heaps.

BC AdBot (Login to Remove)

 


#2 Rimmer

Rimmer

  • Members
  • 2,159 posts
  • OFFLINE
  •  
  • Location:near Sydney, Australia
  • Local time:07:53 AM

Posted 26 October 2005 - 12:46 AM

If you mean copying the file and pasting it into different folders then yes.
If you mean copying data into different application (like Excel spreadsheets) then yes, but I don't know how.
You did not say what your system runs, I'll assume Windows of some sort.

To copy one file to many folders just make a batch file. You will need to know the full path to the file and to the folders. Open notepad and type (or cut n paste) the following:

@echo off
REM
REM MULTIC.BAT
REM
REM syntax = multic_<foldername>_<filename.ext>
REM
REM this batch file copies the file
REM specified in the command line
REM to three pre-existing directories

IF "%2" == "" GOTO NOFILE
IF "%1" == "" GOTO NODIR

COPY C:\%1\%2 C:\BATCH\FOLDER1

COPY C:\%1\%2 C:\BATCH\FOLDER2

COPY C:\%1\%2 C:\BATCH\FOLDER3

GOTO END

:NODIR
echo "*** Error - No directory specified ***"

:NOFILE
echo "*** Error - No file specified ****"

:END

Save this notepad file as MULTIC.BAT in a folder where its easily found.
You can run it from command prompt.
Obviously change the C:\BATCH\FOLDERx names to suit and add more COPY lines if you want to copy to more folders.

There are probably better ways to do this within Explorer but I'll leave that to the gurus.
hth :thumbsup:

Soltek QBIC, Pentium 4 3.0GHz, 512MB RAM, 200GB SATA HDD, ATI Radeon 9600XT 256MB, Netgear 54Mb/s WAP, ridiculously expensive Satellite Broadband
Windows XP Home SP2, Trend Micro Internet Security, Firefox, Thunderbird, AdAwareSE, Spybot S&D, SpywareBlaster, A-squared Free, Ewido Security Suite.

#3 amykt

amykt
  • Topic Starter

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:10:53 AM

Posted 26 October 2005 - 02:51 AM

Thanks - I'll give that a try. Sorry yes I should have said all that information in my post. I'm using Windows XP and i need to copy them into different folders (not applications) so you assumed right. Thanks :thumbsup:

#4 amykt

amykt
  • Topic Starter

  • Members
  • 3 posts
  • OFFLINE
  •  
  • Local time:10:53 AM

Posted 31 October 2005 - 09:20 PM

Hi - I gave what you said an attempt but it was a little confusing and I dont think i did it right because nothing happened! It was perhaps a little over my level of computer understanding. Is there a simpler way? The file type is .mdc and gets used with a program called Cognos-Power Play. The file is copied every Monday morning from C:/ and transferred to all the subfolders within a folder called "cognos reports". Does this help at all?

#5 Rimmer

Rimmer

  • Members
  • 2,159 posts
  • OFFLINE
  •  
  • Location:near Sydney, Australia
  • Local time:07:53 AM

Posted 31 October 2005 - 11:53 PM

Hi - I gave what you said an attempt but it was a little confusing and I dont think i did it right because nothing happened! It was perhaps a little over my level of computer understanding. Is there a simpler way? The file type is .mdc and gets used with a program called Cognos-Power Play. The file is copied every Monday morning from C:/ and transferred to all the subfolders within a folder called "cognos reports". Does this help at all?


So the original file is C:\<yourfilename>.mdc and you need to copy it to all the subfolders of C:\cognos reports all of which are on your computer, is that right?

You need to know the names of these subfolders and specify them in your batch file which would now look more like this: (I have made some changes to accomodate the long folder-name and the fact that these files probably already exist so you will be overwriting them)

@echo off
REM
REM MULTIC.BAT
REM
REM syntax = multic_<filename.ext>
REM
REM this batch file copies the file
REM specified in the command line
REM to three pre-existing directories

IF "%1" == "" GOTO NOFILE

COPY C:\%1 /Y "C:\Cognos Reports\FOLDER1"

COPY C:\%1 /Y "C:\Cognos Reports\FOLDER2"

COPY C:\%1 /Y "C:\Cognos Reports\FOLDER3"

GOTO END

:NOFILE
echo "*** Error - No file specified ****"

:END

Cut and paste this text into a new notepad document, then edit it to have the correct folder names etc. When you finish editing save the file with a ".BAT" ending. For the sake of simplicity save it as C:\MULTIC.BAT (lower case is OK as well).

When you want to use the batch file open a command prompt window by clicking Start>Run and type cmd.
In the black window that opens type CD \ to change the prompt to C:\>
Then type MULTIC <yourfilename>.mdc
You should see a message that says "(1) Files copied" for every subdirectory you put in the batch file.
Then type exit to close your command window and go back to XP.

Give that a go. :thumbsup:

Edited by Rimmer, 31 October 2005 - 11:55 PM.


Soltek QBIC, Pentium 4 3.0GHz, 512MB RAM, 200GB SATA HDD, ATI Radeon 9600XT 256MB, Netgear 54Mb/s WAP, ridiculously expensive Satellite Broadband
Windows XP Home SP2, Trend Micro Internet Security, Firefox, Thunderbird, AdAwareSE, Spybot S&D, SpywareBlaster, A-squared Free, Ewido Security Suite.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users