New Posts  All Forums:Forum Nav:

Batch file help

post #1 of 7
Thread Starter 
Hi Guys,

I am having a little trouble getting some commands to work in a batch file, they seem to work when I copy and paste directly out of notepad, but give me error's when I run them using the batch.

It's only a simple batch, mainly for people who aren't familiar with computers.
It simply duplicated a file 15 times, then it will merge them into a single file...

Would someone please have a look and tell me where i'm going wrong.

CODE:

@echo off
REM Duplicating animation file
for /L %f in (1,1,15) do copy animation.avi %fanimation.avi
REM Merging animations
copy /b 1animation.avi +2animation.avi +3animation.avi +4animation.avi +5animation.avi +6animation.avi +7animation.avi +8animation.avi +9animation.avi +10animation.avi +11animation.avi +12animation.avi +13animation.avi +14animation.avi +15animation.avi output.avi

Cheers
Struggle
(13 items)
 
  
CPUMotherboardGraphicsRAM
QX9650 @ 3.6GHz XFX 790i Ultra SLI GTX280 702/1405/2468 2 x 2GB DDR3 Corsair Dominator 1,333MHz 
Hard DriveOptical DriveOSMonitor
60GB OCZ Summit SSD, WD VelociRaptor, Seagate 1TB LG DVD R/W Windows 7 Pro 64-bit Dell 24" (1920x1200) 
KeyboardPowerCaseMouse
Logitech G19 Fujitech 800W Asus Vento 3600 (Black) Razor Mamba 
  hide details  
Reply
Struggle
(13 items)
 
  
CPUMotherboardGraphicsRAM
QX9650 @ 3.6GHz XFX 790i Ultra SLI GTX280 702/1405/2468 2 x 2GB DDR3 Corsair Dominator 1,333MHz 
Hard DriveOptical DriveOSMonitor
60GB OCZ Summit SSD, WD VelociRaptor, Seagate 1TB LG DVD R/W Windows 7 Pro 64-bit Dell 24" (1920x1200) 
KeyboardPowerCaseMouse
Logitech G19 Fujitech 800W Asus Vento 3600 (Black) Razor Mamba 
  hide details  
Reply
post #2 of 7
%%f instead of %f, have to use another % to escape, it's a batch file thing.
Akiyama Mio
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6420 @ stock, 0.98v Asus P5N-E SLI Gainward GTX 460 1GB @ 800/1600/1900 2x2GB Kingston @ 800MHz 5-5-5-15 2T 
Hard DriveOptical DriveOSMonitor
WD 250GB, 320GB SATA/3, 16MB Cache, Seagate 1TB LG GSA-H62N 18x SATA Ubuntu 9.10 x86 & Win7 x86 Asus VW222U 
KeyboardPowerCase
Logitech Classic Corsair 650HX NZXT Apollo Black 
  hide details  
Reply
Akiyama Mio
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6420 @ stock, 0.98v Asus P5N-E SLI Gainward GTX 460 1GB @ 800/1600/1900 2x2GB Kingston @ 800MHz 5-5-5-15 2T 
Hard DriveOptical DriveOSMonitor
WD 250GB, 320GB SATA/3, 16MB Cache, Seagate 1TB LG GSA-H62N 18x SATA Ubuntu 9.10 x86 & Win7 x86 Asus VW222U 
KeyboardPowerCase
Logitech Classic Corsair 650HX NZXT Apollo Black 
  hide details  
Reply
post #3 of 7
Thread Starter 
Awesome, cheers for that,
One more thing, What's wrong with this line of code in my batch?
I'm trying to copy a file from the C:\ directory to the user's desktop

move file.avi "c:\%UserProfile%\desktop\"

Cheers in advance!
Struggle
(13 items)
 
  
CPUMotherboardGraphicsRAM
QX9650 @ 3.6GHz XFX 790i Ultra SLI GTX280 702/1405/2468 2 x 2GB DDR3 Corsair Dominator 1,333MHz 
Hard DriveOptical DriveOSMonitor
60GB OCZ Summit SSD, WD VelociRaptor, Seagate 1TB LG DVD R/W Windows 7 Pro 64-bit Dell 24" (1920x1200) 
KeyboardPowerCaseMouse
Logitech G19 Fujitech 800W Asus Vento 3600 (Black) Razor Mamba 
  hide details  
Reply
Struggle
(13 items)
 
  
CPUMotherboardGraphicsRAM
QX9650 @ 3.6GHz XFX 790i Ultra SLI GTX280 702/1405/2468 2 x 2GB DDR3 Corsair Dominator 1,333MHz 
Hard DriveOptical DriveOSMonitor
60GB OCZ Summit SSD, WD VelociRaptor, Seagate 1TB LG DVD R/W Windows 7 Pro 64-bit Dell 24" (1920x1200) 
KeyboardPowerCaseMouse
Logitech G19 Fujitech 800W Asus Vento 3600 (Black) Razor Mamba 
  hide details  
Reply
post #4 of 7
Try putting userprofile in upper case. I can't speak for windows, but in unix environmental variables are case sensitive
post #5 of 7
Thread Starter 
Quote:
Originally Posted by Plan9 View Post

Try putting userprofile in upper case. I can't speak for windows, but in unix environmental variables are case sensitive

That doesn't do the trick, let me try googling again...
Struggle
(13 items)
 
  
CPUMotherboardGraphicsRAM
QX9650 @ 3.6GHz XFX 790i Ultra SLI GTX280 702/1405/2468 2 x 2GB DDR3 Corsair Dominator 1,333MHz 
Hard DriveOptical DriveOSMonitor
60GB OCZ Summit SSD, WD VelociRaptor, Seagate 1TB LG DVD R/W Windows 7 Pro 64-bit Dell 24" (1920x1200) 
KeyboardPowerCaseMouse
Logitech G19 Fujitech 800W Asus Vento 3600 (Black) Razor Mamba 
  hide details  
Reply
Struggle
(13 items)
 
  
CPUMotherboardGraphicsRAM
QX9650 @ 3.6GHz XFX 790i Ultra SLI GTX280 702/1405/2468 2 x 2GB DDR3 Corsair Dominator 1,333MHz 
Hard DriveOptical DriveOSMonitor
60GB OCZ Summit SSD, WD VelociRaptor, Seagate 1TB LG DVD R/W Windows 7 Pro 64-bit Dell 24" (1920x1200) 
KeyboardPowerCaseMouse
Logitech G19 Fujitech 800W Asus Vento 3600 (Black) Razor Mamba 
  hide details  
Reply
post #6 of 7
Thread Starter 
Done, needed to remove the C:\

Cheers
Struggle
(13 items)
 
  
CPUMotherboardGraphicsRAM
QX9650 @ 3.6GHz XFX 790i Ultra SLI GTX280 702/1405/2468 2 x 2GB DDR3 Corsair Dominator 1,333MHz 
Hard DriveOptical DriveOSMonitor
60GB OCZ Summit SSD, WD VelociRaptor, Seagate 1TB LG DVD R/W Windows 7 Pro 64-bit Dell 24" (1920x1200) 
KeyboardPowerCaseMouse
Logitech G19 Fujitech 800W Asus Vento 3600 (Black) Razor Mamba 
  hide details  
Reply
Struggle
(13 items)
 
  
CPUMotherboardGraphicsRAM
QX9650 @ 3.6GHz XFX 790i Ultra SLI GTX280 702/1405/2468 2 x 2GB DDR3 Corsair Dominator 1,333MHz 
Hard DriveOptical DriveOSMonitor
60GB OCZ Summit SSD, WD VelociRaptor, Seagate 1TB LG DVD R/W Windows 7 Pro 64-bit Dell 24" (1920x1200) 
KeyboardPowerCaseMouse
Logitech G19 Fujitech 800W Asus Vento 3600 (Black) Razor Mamba 
  hide details  
Reply
post #7 of 7
oh hang on, you're doing c:\c:\ as %USERPROFILE% contains the drive letter too. So drop your c:\

for the record, if you want to check what's being held in an env, then just echo %USERPROFILE% in your console.

[edit]

Sorry, I didn't see your last post (possibly a weird caching issue in Opera?).
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming