By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,404 Members | 2,512 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,404 IT Pros & Developers. It's quick & easy.

working with dos prompt

P: 49
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.
Sep 8 '07 #1
Share this Question
Share on Google+
6 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

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

Expand|Select|Wrap|Line Numbers
  1. CALL C:\MyNewBatch.BAT 
  2.  
REgards
Veena
Sep 8 '07 #2

hariharanmca
100+
P: 1,977
Hi,

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

Expand|Select|Wrap|Line Numbers
  1. CALL C:\MyNewBatch.BAT 
  2.  
REgards
Veena
Hi QVeen72, Can you explain where and how can we call it?
To call .bat file i use
Expand|Select|Wrap|Line Numbers
  1. shell("C:\MyNewBatch.BAT")
Sep 8 '07 #3

QVeen72
Expert 100+
P: 1,445
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
Sep 8 '07 #4

P: 49
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
Sep 11 '07 #5

QVeen72
Expert 100+
P: 1,445
Hi,

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

Expand|Select|Wrap|Line Numbers
  1. sqlldr userid=scott/tiger  control=x:\abc.ctl log=x:\abc.log 
  2.  
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
Sep 11 '07 #6

Expert 5K+
P: 8,434
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.
Sep 12 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.