working with dos prompt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jayachandra
    New Member
    • Mar 2007
    • 49

    working with dos prompt

    Hi to all,

    I have a question. I am running a batch file which has one parameter such as user name. Now I want to pass another parameter such as a password from another batch file. In the first batch file it asks user name - for this I need to pass automatically through VB program. Please help me in this concept.


    Thank you all.
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    I think u have to use the "Call Function" to run anothr Batch file:

    [code=vb]
    CALL C:\MyNewBatch.B AT
    [/code]

    REgards
    Veena

    Comment

    • hariharanmca
      Top Contributor
      • Dec 2006
      • 1977

      #3
      Originally posted by QVeen72
      Hi,

      I think u have to use the "Call Function" to run anothr Batch file:

      [code=vb]
      CALL C:\MyNewBatch.B AT
      [/code]

      REgards
      Veena
      Hi QVeen72, Can you explain where and how can we call it?
      To call .bat file i use [CODE=vb]shell("C:\MyNew Batch.BAT")[/CODE]

      Comment

      • QVeen72
        Recognized Expert Top Contributor
        • Oct 2006
        • 1445

        #4
        Hi Hari,

        He wanted to call one more batch file in a BatchFile.
        The Call function has to be written in the Calling or Main BatchFile.


        Regards
        Veena

        Comment

        • Jayachandra
          New Member
          • Mar 2007
          • 49

          #5
          Thank you for reply.

          Actually I have written a batch file like

          sqlldr userid=scott control=x:\abc. ctl log=x:\abc.log

          When I run this, it will ask Password. Then immediately I need to pass the password through a password.bat this password.bat may contain password. It should pass to password at command prompt where the first batch file is waiting for password.

          Is it possible ? Please reply anybody.

          Thank you

          Comment

          • QVeen72
            Recognized Expert Top Contributor
            • Oct 2006
            • 1445

            #6
            Hi,

            In your .bat you can directly give username/password:

            [code=vb]
            sqlldr userid=scott/tiger control=x:\abc. ctl log=x:\abc.log
            [/code]

            If you don't want to hardcode it, or the password keeps changing, then drop and recreate the Batch file with username and password at run time from Front End.

            Regards
            Veena

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              If I read the question correctly, what the OP needs is for the Password.Bat to effectively stack the password into standard input to be picked up by the program which prompts for it.

              I don't know how you would go about this.

              What about running your VB program first to prompt for the password, then have it generate and execute the batch file with the password included? Of course, you'd probably want to delete the batch file after running it.

              Comment

              Working...