We help IT Professionals succeed at work.
Get Started

Prompt for User Credentials in BAT file

jforville
jforville asked
on
10,267 Views
Last Modified: 2012-05-05
How do I ask the user to supply a network username/password when connected to a network via a VPN connection?  For example, I want to run the following command from a BAT file:
xcopy \\<servername>\<sharename>\*.atp "C:\PfX Documents\Binder\Templates\*.*" /D.  It's easy enough when I do the Net Use command and map to a device, since the OS (Win2000/XP) will prompt for a username.  But without running the Net Use command, as in my example, I just get the message "Invalid Drive Specification".  It will work fine if I first do a Run command using \\<servername> and ride username/password.  However, I am trying to prevent the users from doing anything other than connect to the VPN and running a BAT file.  The connecting PC's are not members of the Domain, but the users are.
Comment
Watch Question
Technology and Business Process Advisor
CERTIFIED EXPERT
Most Valuable Expert 2013
Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE