Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I stop a .bat file asking for a username and password?

Posted on 2007-11-26
5
Medium Priority
?
845 Views
Last Modified: 2008-02-24
I have created a batch file which maps a number of network drives from two different file servers.

When it runs, it asks for a username and password so that it can create the network drive on FS1. However, it does not ask for a username and password when connecting to FS2.

I want the user to have to enter their login details when they try to access the drive through My Computer, and not by entering them into the .bat file.

Any assistance is appreciated.
0
Comment
Question by:finpjenn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 20

Expert Comment

by:jimmymcp02
ID: 20361502
you could do the following

net use g: \\serveraddress\c$ yourpassword /user:Yourusername
0
 
LVL 20

Expert Comment

by:jimmymcp02
ID: 20361512
ooppps... read to quickly..... thats not what you asked for.
0
 

Author Comment

by:finpjenn
ID: 20362028
lol, no problem, thank you for trying anyways.
0
 
LVL 9

Expert Comment

by:bigjimbo813
ID: 20371783
Are the credentials the same on both servers?
Are they both on the same domain?
If not are the domains trusted?

I dont think there is a way to request credentails after the drive has been mapped (assuming connection wasnt killed).
0
 
LVL 29

Accepted Solution

by:
matrixnz earned 2000 total points
ID: 20388004
Hi finpjenn

You can do it using a persistant drive mapping, however initially they would need to enter there details using the batch, for example

NET USE G: \\SERVER1\SHARE /user:DOMAIN\%USERNAME% /PERSISTENT:YES
NET USE H: \\SERVER2\SHARE /PERSISTENT:YES

When the user restarts or logs off and back on again the mapped drives will exist but when clicked should prompt the user for their username and password.

Although if you were in a domain environment the user shouldn't have to enter a username and password at all, as authentication should be done at logon.

Hope that helps.

Cheers
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question