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

Author Topic: .bat file help needed......  (Read 6097 times)

0 Members and 1 Guest are viewing this topic.

6CA7man

    Topic Starter


    Starter

    .bat file help needed......
    « on: December 18, 2009, 08:35:06 PM »
    If I launch a simple bat file from a path on a network:
    \\WinSrv\cr5\Dept400\me\Testing\batFiles\

    then the bat executes goes to a Unix path and grabs a file (my question is this) it should then place it in here:
    \\WinSrv\cr5\Dept400\me\Testing\batFiles\
    Since that was where the bat file was launched from ???? But I am not getting that result. Testing it in the C:\ it worked fine from the WinSrv path it did not work.

    Is there a better way?

    notes: %1 = userID, %2 = userPW, %3 = fileName

    Code: [Select]
    Echo %1> ftpcmd.txt
    echo %2>> ftpcmd.txt
    echo ascii>> ftpcmd.txt
    echo prompt n>>ftpcmd.txt
    echo cd /unixPath1/parts/parts2/b/xm/data/>> ftpcmd.txt
    echo get %3>> ftpcmd.txt
    echo bye >> ftpcmd.txt
    ftp -s:ftpcmd.txt 100.11.100.01
    del ftpcmd.txt
    ren \\WinSrv\cr5\Dept400\me\Testing\batFiles\%3 %3.txt
    quit


    btw this is a really nice forum! It's got a different look and feel to it........nice job!

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: .bat file help needed......
    « Reply #1 on: December 18, 2009, 10:05:22 PM »
    Your post is hard to understnad.
    Are you trying to move a file from your local; machine to a sever on the network?
    Where is the batch file?
    What is the detonation directory?
    This notation:
    Quote
    notes: %1 = userID, %2 = userPW, %3 = fileName
    Is a bit hard to follow. Can you just give the actual invocation? Or something very close. Like maybe:
    Quote
    myupload pinkpatty qwerty mybiki.jpg
    You have the path name two different ways. Why?
    Where did you expect the file to go?
    What is the full name of the detonation you want?
    Quote
    Since that was where the bat file was launched from
    Are you sure of that?

    6CA7man

      Topic Starter


      Starter

      Re: .bat file help needed......
      « Reply #2 on: December 19, 2009, 12:01:16 PM »
      Your post is hard to understnad.
      Are you trying to move a file from your local; machine to a sever on the network?

      I am using the get command from Unix server to a windows server; I am working from a pc on a network.
      Once I log into Unix I cd /unixPath1/parts/parts2/b/xm/data Needed Is Here/>>

      Where is the batch file?
      What is the detonation directory?

      \\WinSrv\cr5\Dept400\me\Testing\batFiles\batFileIsHere.bat
      \\WinSrv\cr5\Dept400\me\Testing\batFiles\destination Is Here also

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: .bat file help needed......
      « Reply #3 on: December 19, 2009, 12:53:47 PM »
      I  give up.

      6CA7man

        Topic Starter


        Starter

        Re: .bat file help needed......
        « Reply #4 on: December 19, 2009, 05:29:50 PM »
        I  give up.

        I think I have it now:

        Code: [Select]
        Echo %1> ftpcmd.txt
        echo %2>> ftpcmd.txt
        echo ascii>> ftpcmd.txt
        echo prompt n>>ftpcmd.txt
        echo cd /unixPath1/parts/parts2/b/xm/data/>> ftpcmd.txt
        echo get "%3" "%3">> ftpcmd.txt
        echo bye >> ftpcmd.txt
        ftp -s:ftpcmd.txt 100.11.100.01
        del ftpcmd.txt
        lcd \\WinSrv\cr5\Dept400\me\Testing\batFiles\
        ren "%3" "%3.txt"
        quit

        Geek-9pm


          Mastermind
        • Geek After Dark
        • Thanked: 1026
          • Gekk9pm bnlog
        • Certifications: List
        • Computer: Specs
        • Experience: Expert
        • OS: Windows 10
        Re: .bat file help needed......
        « Reply #5 on: December 19, 2009, 06:33:17 PM »
        Glad I was able to help.  :)

        6CA7man

          Topic Starter


          Starter

          Re: .bat file help needed......
          « Reply #6 on: December 19, 2009, 06:37:28 PM »
          Glad I was able to help.  :)

          LOL      :D


          yeah, no matter how tough things got you never gave up!