Solved

Windows batch files

Posted on 2016-11-17
3
60 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
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
Michael Pfister earned 500 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 28

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
OfficeMate Freezes on login or does not load after login credentials are input.
In this Micro Tutorial viewers will learn how to restore their server from Bare Metal Backup image created with Windows Server Backup feature. As an example Windows 2012R2 is used.
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…

765 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