Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Windows 7 net use security

Posted on 2014-09-26
6
Medium Priority
?
29 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
  • 2
4 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

I wrote an article (http://www.experts-exchange.com/articles/2245/Anti-rootkit-software.html) some time ago with a reference to nLite  (http://www.nliteos.com/)slipstreaming software.  I recently changed that link to point to NTLite (https://www.ntl…
In this article we have discussed the manual scenarios to recover data from Windows 10 through some backup and recovery tools which are offered by it.
Integration Management Part 2
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…
Suggested Courses

877 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