Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: copy and rename file with path name  (Read 15512 times)

0 Members and 1 Guest are viewing this topic.

novice84

    Topic Starter


    Rookie

    • Experience: Beginner
    • OS: Windows 7
    Re: copy and rename file with path name
    « Reply #30 on: June 29, 2013, 06:29:51 AM »
    Hi Foxidrive
    sorry I didn't look at first sight and replied.
    thanks for that, I checked it and changed it 3 different versions as per requirement before I saw you reply.
    I have a question again :-X
    As I asked for advise before is there any such kind of thing if you don't know DOS and C++ you can't leran/Understand VB very well (as my 2 friends advised)
    my knowledge of DOS is very of few basic commands which I learned 15 years before in school.
    I want to learn VBA to automate few task in softwares like excel and many other applications which has customisation thru VBA so we can automate our daily tasks.
    what's your advise as per your experience should I spend time learning DOS and C++ or VBA we can learn without learning these.

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: copy and rename file with path name
    « Reply #31 on: June 29, 2013, 06:48:07 AM »
    I haven't used VBA so I can't give an informed opinion.

    Lemonilla



      Apprentice

    • "Too sweet"
    • Thanked: 70
    • Computer: Specs
    • Experience: Experienced
    • OS: Windows 7
    Re: copy and rename file with path name
    « Reply #32 on: June 29, 2013, 08:34:25 AM »
    another problem that I noticed was that you can't change drives with 'cd'

    so change 'cd %1' to
    Code: [Select]
    %~d1
    cd %1

    this should put you in the write directory. You can add 'cd' to a third line and it will echo the current directory for you to double check if you want.
    Quote from: patio
    God Bless the DOS Helpers...
    Quote
    If it compiles, send the files.

    Salmon Trout

    • Guest
    Re: copy and rename file with path name
    « Reply #33 on: June 29, 2013, 09:01:33 AM »
    another problem that I noticed was that you can't change drives with 'cd'

    You can use the cd command to change to a folder on another drive if you use the /d switch. I always use that switch after cd, it has no effect if the new folder is on the same drive.

    you are in c:\test, you want to go to D:\pictures\holidays you do this: cd /d D:\pictures\holidays, it is the same as doing first D: and then cd pictures/holidays.

    Salmon Trout

    • Guest
    Re: copy and rename file with path name
    « Reply #34 on: June 29, 2013, 12:14:17 PM »
    I always use that switch after cd, it has no effect if the new folder is on the same drive.

    That means, more clearly, the /d switch does no harm if the new folder is on the same drive.

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: copy and rename file with path name
    « Reply #35 on: June 29, 2013, 12:53:47 PM »
    another problem that I noticed was that you can't change drives with 'cd'

    so change 'cd %1' to
    Code: [Select]
    %~d1
    cd %1

    this should put you in the write directory. You can add 'cd' to a third line and it will echo the current directory for you to double check if you want.
    That was the point of my previous post and told you to read the help for that command. You were not using the correct syntax.

    Lemonilla



      Apprentice

    • "Too sweet"
    • Thanked: 70
    • Computer: Specs
    • Experience: Experienced
    • OS: Windows 7
    Re: copy and rename file with path name
    « Reply #36 on: June 29, 2013, 04:17:25 PM »
    That was the point of my previous post and told you to read the help for that command. You were not using the correct syntax.
    My apologies, I missed your earlier post. Thank you for pointing it out, could come in handy.
    Quote from: patio
    God Bless the DOS Helpers...
    Quote
    If it compiles, send the files.