?
Solved

Windows batch files

Posted on 2016-11-17
3
Medium Priority
?
90 Views
Last Modified: 2016-11-17
I need to create a batch file that runs on a machine and connects network drives. The machine and file server are on different domains but are trusted.

The batch file needs to ask the user for credentials then pass those credentials for authentication.

Any pointers?
0
Comment
Question by:IST
[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
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
Michael Pfister earned 2000 total points
ID: 41891598
set /p NETUSER=Please enter user name for connection:
If defined NETUSER net use * \\SERVER\Share /user:OTHERDOMAIN\%NETUSER% 

Open in new window


This will prompt the user for a user name and pass it to the net use command. replace SERVER, Share and OTHERDOMAIN with your values
0
 
LVL 29

Expert Comment

by:Michael Pfister
ID: 41891601
On the other hand since there is a trust you should be able to grant the user from domain A access to ressources in domain B.
No need to prompt for username...
0
 

Author Closing Comment

by:IST
ID: 41891617
Great, works fine....
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Resolve DNS query failed errors for Exchange
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
Suggested Courses

771 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