Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto answering a username and password prompt 1

Status
Not open for further replies.

obulldog27

Programmer
Apr 26, 2004
169
US
My company prints to a remote printer thru dos foxpro. before the program is executed the printer is added using net use. However I get a what is username and then password which i can type in to access our remote lan but i would like to automate this process.
here is the bat file that i have to start foxpro
and i have tried doing echo but does not work
---------------------------------------------------
F:
cd\apps\invprod
net use lpt1: \\serverip\printer sharename
echo <username>
echo <password>
pause
C:\FOXPRO25\FOXPROX MAINMENU
net use lpt1: /delete
CD\C:\WINDOWS
EXIT
--------------------------------
here is the respone i get when clicking the bat file
before foxpro startup
--------------------------------------------
F:\>cd\apps\invprod

F:\Apps\INVPROD>net use lpt1: \\serverip\printername
The password is invalid for \\serverip\printername

Enter the user name for 'serverip': <enter username>
Enter the password for 'serverip': <enter password>

-----------------------------
so basically i want the maching to answer this for me


 
Out of curiosity, did you try asking for help by way of:

-----
1) C:\net /? | more

-or-

2) C:\net logon /? | more
-----

I know this seems too obvious; however, I have to ask. If, on the off-chance, you didn't, I'd suggest you try both of the above. The 'NET' commands have been modified from W9x OS. If you don't pipe the output, you'll miss some of the more important info at the top.

Let us know what happens.
--MiggyD
 
in windows 2000 (i know your using foxpro...no idea if its similar) this is the syntax needed:

net use devicename [/home[password | *]] [/delete:{yes | no}]

i agree with MiggyD...check your help files for the correct connection.

Chris Castelein
Shive-Hattery
Cedar Rapids, ia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top