Re: Accessing network PCs
- From: "Larry Smith" <no_spam@xxxxxxxxxxx>
- Date: Wed, 23 May 2007 14:14:11 -0400
The easiest solution for this is to create a "use record" for your login
session.
the command should look like:
"net use \\otherpc\sharename passwd /user:validUserOnOtherpc"
The way you do this is by placing a "net use" command in your autoexec.bat
file.
Another option is to execute the above "net use" from your code (using
System.Diagnostics.Process.Start), this way you can delete the network
connection when done with it.
Note that you can use the IPC$ instead of a share name, this gives you
access to all of the resources on the "other" pc.
There should be a .NET function for this somewhere however since spawning
"net.exe" from code is ugly IMO (and he shouldn't publish his password in a
batch file if he decides to go that route). Also note that IPC$ is really
just a login (authentication) resource for all intents and purposes (unlike
other resources where a DACL check is immediately conducted against the
resource). Once your're authenticated on the remote machine using IPC$, your
network session on that machine is still subject to normal access checks on
whatever resources you touch (which gets into shared resource permissions vs
normal NTFS permissions but that's another story). Access denied can still
occur IOW if you later touch a resource you don't have access to (whereas
access denied will occur right away if you authenticate against the target
resource from the outset, opposed to IPC$).
.
- Follow-Ups:
- Re: Accessing network PCs
- From: Willy Denoyette [MVP]
- Re: Accessing network PCs
- References:
- Accessing network PCs
- From: accyboy1981
- Re: Accessing network PCs
- From: Willy Denoyette [MVP]
- Accessing network PCs
- Prev by Date: Browser Object - NavigateComplete2 event.
- Next by Date: Re: Declaring variables in loops
- Previous by thread: Re: Accessing network PCs
- Next by thread: Re: Accessing network PCs
- Index(es):
Relevant Pages
|