Solved

Windows 7 net use security

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

1. Start | Settings | Printers and Faxes. 2. Go to the File Menu. 3. Select Server Properties. 4. Select the Drivers tab. 5. Select the printer you need information about. 6. Once again select Properties. You should get a list of the files requ…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now