• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 100
  • Last Modified:

Windows batch files

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
IST
Asked:
IST
  • 2
1 Solution
 
Michael PfisterCommented:
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
 
Michael PfisterCommented:
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
 
ISTAuthor Commented:
Great, works fine....
0

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now