Solved

Windows 7 net use security

Posted on 2014-09-26
6
21 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 500 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

Windows running painfully slow? Try these tips..

Stay away from Speed Up Computer Programs that do more harm than good.
Try these tips instead.
Step by step instructions in trouble shooting Windows Performance issues.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
USB3 drive - file system corruption issue 10 63
domain user access for some applications 8 46
Staging desktop / laptop tools 5 134
How to change Driver for Display 12 87
It is a common problem that often server suffers from the lack of space on system volume. Old servers or new ones from vendors come with preformatted small volume - 5-6GB in total and after installing updates or applications the free space on system…
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 …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
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…

734 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