Username / Domain formatting support
Thru uses the Net Use command to connect to a shared resource.
Thru call’s the Directory.GetFileSystemEntries() on the path in the config to decide whether or not we're able to connect.
First, Thru calls this without net use. If it succeeds, we consider the connection successful regardless of domain/username/password.
If it fails, Thru format’s the net use command like this if there is an entry in the domain field:
/C net use \"{_networkPath}\" /user:\"{_domain}\\{_username}\" \"{_password}\" /persistent:Yes
or like this if there is nothing in the domain field:
/C net use \"{_networkPath}\" /user:\"{_username}\" \"{_password}\" /persistent:Yes
if this fails, we add a .\ to the command and try again like this:
/C net use \"{_networkPath}\" /user:\".\\{_username}\" \"{_password}\" /persistent:Yes
Finally if this fails, Thru makes one more attempt with 'local' before considering it a failure:
/C net use \"{_networkPath}\" /user:\"local\\{_username}\" \"{_password}\" /persistent:Yes
Syntax
net use [{<DeviceName> | *}] [\\<ComputerName>\<ShareName>[\<volume>]] [{<Password> | *}]] [/user:[<DomainName>\]<UserName] >[/user:[<DottedDomainName>\]<UserName>] [/user: [<UserName@DottedDomainName>] [/savecred] [/smartcard] [{/delete | /persistent:{yes | no}}]
net use [<DeviceName> [/home[{<Password> | *}] [/delete:{yes | no}]]
net use [/persistent:{yes | no}]