简体   繁体   中英

Access to remote Windows PC with username and password in path

I would like to access remote computer with Windows to modyify files (i need copy file from my PC to remote PC). Problem is that remote PC got admin account with password so I must use authentication. I remember that I can pass username and login in path, someting like that:

\\remote_pc_login?admin_username:admin_password\\C$\\test.txt

But I don't remember exactly how it should look the path. Maybe someone from you guys can help me?

Ps. If this is not passible maybe you got idea how to make application in C# (simple console application) to got access to files when I got IP and username with password.

Ps2. Remote PC is in local network, but I don't think it matters.

Try this.

net use \\myserver /user:username password

You have few ways to get it done via C#. Easy and dirty one is to wrap the above command in

System.Diagnostics.ProcessStartInfo

Another way is to authenticate the user via ActiveDirectory, and then he can access the shared drive. You can find tons of C# code samples to do this...

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM