what are 'NET USE' possible outputs?

227 views Asked by At

The question is : what are the NET USE possible outputs?

You can drown yourself with websites explaining how to use NET USE command, but not a single one about what is coming out of it.

In my case I'm interested in the various error messages, and the interaction with the Powershell automatic variable $LASTEXITCODE. I want to handle its output correctly but I don't know what can even happen (and no, I won't use New-PSDrive).

Does someone knows the what or where I can find the information ?

Thanks

1

There are 1 answers

2
borealis-c On

You can use the example in https://www.compatdb.org/forums/topic/20487-net-use-return-code/ to obtain a list of the numerical codes for your evaluation.

If you want to dig deeper take you need to download the Win32 SDK and go through the definitions in the header files (see https://learn.microsoft.com/en-us/windows/win32/api/winnetwk/ns-winnetwk-netresourcea etc).