Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. 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. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

Copy and rename files

- - - - -

  • Please log in to reply
2 replies to this topic

#1
Octopuss

Octopuss

    I am the walrus

  • Member
  • PipPipPipPipPipPip
  • 1,127 posts
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

I am trying something a bit funky here.

I got a batch file I use to copy various installation files somewhere, and they are launched with different batch. I don't want to change both when files with version numbers in them get updated (and I don't rename them after downloading because I like to keep track of what they are).

Anyway, I hoped I could use copy command with wildcards to copy files somewhere and change the destination name. It doesn't seem to work.

Example:

copy e:\Install\OS\jre-6*.exe d:\win7-64\sources\$OEM$\$1\Install\java.exe /y

It looked like it did what I wanted, but then I realized the destination file was like 5kB in size. WTF? Anyone can explain this? Or suggest different approach?

Edited by TheWalrus, 14 January 2013 - 01:44 PM.



How to remove advertisement from MSFN

#2
5eraph

5eraph

    Update Packrat

  • MSFN Sponsor
  • 1,137 posts
  • OS:XP Pro x64
  • Country: Country Flag

Donator

Had this problem recently with mismatched wildcards for source/target. Try XCOPY. ;)

ECHO F|XCOPY e:\Install\OS\jre-6*.exe d:\win7-64\sources\$OEM$\$1\Install\java.exe /V /Q
Note: The piped ECHO command bypasses the XCOPY prompt to ask if the target is a file or folder.

#3
Octopuss

Octopuss

    I am the walrus

  • Member
  • PipPipPipPipPipPip
  • 1,127 posts
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

Oh! Thank you!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN