Solved

Windows 7 net use security

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

 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

Question has a verified solution.

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

In its Critical Driver Installation Order document, Intel stresses that this sequence be followed:   1       Fresh Operating System Installation 2       Latest Service Pack or Patch 3       Intel® Chipset Software Installation Utility (INF Utili…
One good source is the manufacturer's web site. Even though the device operating system is changing, the hardware isn't. Going to the support site and looking at the Vista drivers provides a starting point for identifying system hardware for which d…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

617 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