/build/static/layout/Breadcrumb_cap_w.png

How do I check if a user has rights to a network share?

Hi there, sounds simple, but I'd like to make clear what I am trying to do.

net view, net share and net use did not work for me through a DOS command.

I know how to create a share with net use,


But what I need is a way to use a DOS command to

1.check to see if the user has access to a network share
2.If not, then return some type of code

If I can get some type of return on a code, then I can use that and pass it into a variable for logic.

Anyone?

0 Comments   [ + ] Show comments

Answers (2)

Posted by: anonymous_9363 14 years ago
Red Belt
0
If you *must* use DOS (any sane person would probably use VBScript, but the same principle applies), try to create a file on the share. If the error returned is 5, that's 'Access Denied'.
Posted by: TheInfamousOne 14 years ago
Purple Belt
0
Never mind, I figured it out. It was quite simple.

I used

if exist \\server\\path echo connection established >> c:\temp\connection.txt

Then I just used Wise to read the lines from the text file and continued with logic.

problem solved.

Sorry for the unnecessary post.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ