views:

89

answers:

3

On whatever reason this is not working [gives 'file not found']

set in=c:\myprogram\_save
cd %temp%
ren 1RO.dat "Titanic Moves 1 of 3 Rotterdam.dat"
ren 12RO.img "Titanic Moves 1 of 3 Rotterdam.img"
ren 2HA.dat "Titanic Moves 2 of 3 Hawai.dat"
ren 22HA.img "Titanic Moves 2 of 3 Hawai.img"
ren 3NY.dat "Titanic Moves 3 of 3 NY.dat"
ren 33NY.img "Titanic Moves 3 of 3 NY.img"
copy "Titanic Moves 1 of 3 Rotterdam.dat" "%in%"
copy "Titanic Moves 1 of 3 Rotterdam.img" "%in%"
copy "Titanic Moves 2 of 3 Rotterdam.dat" "%in%"
copy "Titanic Moves 2 of 3 Rotterdam.img" "%in%"
copy "Titanic Moves 3 of 3 Rotterdam.dat" "%in%"
copy "Titanic Moves 3 of 3 Rotterdam.img" "%in%"
del "Titanic Moves 1 of 3 Rotterdam.dat"
del "Titanic Moves 1 of 3 Rotterdam.img"
del "Titanic Moves 2 of 3 Rotterdam.dat"
del "Titanic Moves 2 of 3 Rotterdam.img"
del "Titanic Moves 3 of 3 Rotterdam.dat"
del "Titanic Moves 3 of 3 Rotterdam.img"

can someone help me??

EDIT: this is what's happening before [helper45 = 7zip commandline executable]

ren package.temp package.zip
copy package.zip %temp%
del package.zip
helper45 e "%temp%\package.zip"

'e' is the extract command

+1  A: 

I just noticed an obvious error. If that script is literally what you have, then the error is below. If it is not, I'm sure as hell going to downvote the question for providing incorrect information.

Anyway, look below.

Two Rotterdam files (1 of 3):

ren 1RO.dat "Titanic Moves 1 of 3 Rotterdam.dat"
ren 12RO.img "Titanic Moves 1 of 3 Rotterdam.img"

Two Hawai files (2 of 3):

ren 2HA.dat "Titanic Moves 2 of 3 Hawai.dat"
ren 22HA.img "Titanic Moves 2 of 3 Hawai.img"

Two NY files (3 of 3):

ren 3NY.dat "Titanic Moves 3 of 3 NY.dat"
ren 33NY.img "Titanic Moves 3 of 3 NY.img"

Two Rotterdam files (1 of 3):

copy "Titanic Moves 1 of 3 Rotterdam.dat" "%in%"
copy "Titanic Moves 1 of 3 Rotterdam.img" "%in%"

Another two Rotterdam files, 2 of 3 -- but the "2 of 3" files above are Hawai!

copy "Titanic Moves 2 of 3 Rotterdam.dat" "%in%"
copy "Titanic Moves 2 of 3 Rotterdam.img" "%in%"

Still two more Rotterdam files, 3 of 3 -- but the "3 of 3" files above are NY!

copy "Titanic Moves 3 of 3 Rotterdam.dat" "%in%"
copy "Titanic Moves 3 of 3 Rotterdam.img" "%in%"

The same error is present in the lines below:

del "Titanic Moves 1 of 3 Rotterdam.dat"
del "Titanic Moves 1 of 3 Rotterdam.img"
del "Titanic Moves 2 of 3 Rotterdam.dat"
del "Titanic Moves 2 of 3 Rotterdam.img"
del "Titanic Moves 3 of 3 Rotterdam.dat"
del "Titanic Moves 3 of 3 Rotterdam.img"

If that doesn't help, remove any "@echo off" from the batch file, and show us a copy&paste from the error with the line it happens at.

Daniel
No there aren't.
YourComputerHelpZ
^ forget about that comment. It was indeed. I copied the commands so that it didnt took a lot of time. But it does now.
YourComputerHelpZ
+1  A: 

I'd suspect at least one of the files you are trying to copy/delete do not exist. You can see which line gives that error by looking directly above the error message (and removing the echo off from the batch, if there is one).

Furthermore, why are you doing rename, copy and delete operations in that order? You can just as easily roll them all into one move operation per file:

move 1RO.dat "%in%\Titanic Moves 1 of 3 Rotterdam.dat"
move 12RO.img "%in%\Titanic Moves 1 of 3 Rotterdam.img"
move 2HA.dat "%in%\Titanic Moves 2 of 3 Hawai.dat"
move 22HA.img "%in%\Titanic Moves 2 of 3 Hawai.img"
move 3NY.dat "%in%\Titanic Moves 3 of 3 NY.dat"
move 33NY.img "%in%\Titanic Moves 3 of 3 NY.img"
Joey
A: 

I would use pushd instead of cd so that if you are calling it from a different drive it works.

Philibert Perusse