Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Windows 7 net use security

Posted on 2014-09-26
6
Medium Priority
?
26 Views
Last Modified: 2016-07-15
I have got over it before but cannot remember how, when running a net use login script to link drives/printers from one machine to another it prompts for the user name and password of the resource that we are linking to, this is on a very small 2 pc peer to peer network. I have included the user  password in the batch file but this does not work type the exact command into the command line and it works.  Windows fire wall has been disabled on both machines no other firewall is running on either machine. any prompt would be appreciated.
0
Comment
Question by:pcane
[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
6 Comments
 
LVL 31

Accepted Solution

by:
Frosty555 earned 2000 total points
ID: 40346872
Explicitly specifying the username and password in the NET USE command in a batch file is supposed to work (putting aside the security issues of including the password in plaintext in a batch file).

You can make sure you specify the computer name of the remote resource as well, e.g.

NET USE \\SOMECOMPUTER\somefolder /USER:SOMECOMPUTER\johndoe sup3rstr0ngp4ssw0rd

Open in new window


Do you have something weird going on in the Batch file, environment variables or something else and maybe the command is not what you think it is?  Try turning on echo (e.g. remove the "@echo off" from the batch file) so you can see the actual command that is being executed

Or, make the username and password match on both sides, which will cause the NET USE command to succeed without requiring you to explicitly specify any credentials on the command line.

Lastly, the batch file is running in the security context of the currently logged in user, not being "Run As Administrator", or running as the local system account or something else in a scheduled task, right?
0
 

Author Comment

by:pcane
ID: 40346885
Thanks for your input. will be checking in the morning if these options solve the problem. Thanks
0
 
LVL 13

Expert Comment

by:akb
ID: 40347126
Maybe there is a space in the username or password?
0
 
LVL 13

Expert Comment

by:akb
ID: 41713686
Frosty555's answer should be accepted as the solution.
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

A while back when OPSMGR 2012 was released we were very excited about getting it into our environment and upgrading our 2007 implementation,  we started our planning and we then proceeded with our implementation. All went as planned & our system …
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

670 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