Need help “system() function problem”

Asked By 10 points N/A Posted on -
qa-featured

Hello

I create a simple program that need to rename a bunch of files

  1. #include <stdio.h>
  2.  
  3. int main(){
  4.  
  5. int count;
  6.  
  7. for(count = 1; count <= 95; count++){
  8.  
  9. if(count >= 10){
  10. system("rename "C:\wamp\www\anime\kenshin\Rurouni Kenshin – %d.mkv" "%d.mkv"", count, count);
  11. }
  12.  
  13. /* For the episodes that have 0 before the number e.g 01..09 */
  14. system("rename "C:\wamp\www\anime\kenshin\Rurouni Kenshin – %d%d.mkv" "%d.mkv"", 0, count, count);
  15. }
  16.  
  17. return 0;
  18. }

I always come up on this error "too many actual parameters". I also receive "The system cannot find the file specified."

Can someone help a newbie out?

SHARE
Best Answer by Hoting Gracia
Best Answer
Best Answer
Answered By 0 points N/A #118582

Need help “system() function problem”

qa-featured

Hello Patrick C is the programming Language developed by Dennis Ritchie and now it is the basic for any programming language as major benefits are only with C language.

It's very clear that you are trying to rename many number of files at a time available in the system and its possible but there will be more confusion in performing this to complete.

As in the error it refers you have " too many actual parameters " it indicates that there are more than enough parameters present in the program.

And even another one more error is indicating that the system cannot find the file specified in the given path by you in the system.

So it's better to check all the names of files and other things as if one go wrong whole will not be occurred so have to take care with the errors to be occurred in future.

Thank You.

Login/Register to Answer

Related Questions