Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to copy files to a password protected shared folder on another server

Posted on 2012-03-22
4
Medium Priority
?
1,739 Views
Last Modified: 2012-03-27
Hi,

I can manually in Windows 7: Type in Run: \\<ip address>\sharedFolder, type in my username and password, a folder opens in Windows Explorer, I can then copy a file to the shared folder.

How can I do this in C#? I can do a File.Copy() but I can't get around the part about specifying the username/password.

Thanks,
Dan
0
Comment
Question by:DanTartaglia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 80

Assisted Solution

by:arnold
arnold earned 501 total points
ID: 37755762
Not sure about c#, what about powershell? There are many examples including vbscript.
Within c# you would run net use to map a drive to a unc
http://www.c-sharpcorner.com/UploadFile/DipalChoksi/ShellCommandsInCS12032005042031AM/ShellCommandsInCS.aspx
0
 
LVL 6

Accepted Solution

by:
netjgrnaut earned 999 total points
ID: 37757030
...or run NET USE to connect to \\ServerName\IPC$ with a user and password specified.  Then you can write to the \\ServerName\Share of choice without having to map a drive.
0
 

Author Comment

by:DanTartaglia
ID: 37757104
Thanks to both of you. I'll use the NET USE command one way or the other.
0
 
LVL 6

Assisted Solution

by:netjgrnaut
netjgrnaut earned 999 total points
ID: 37757175
http://social.msdn.microsoft.com/Forums/pl-PL/winforms/thread/a8ccaacb-85c2-4129-a55f-748c4bff3cf5

You might find that discussion helpful, if you want to go the C# route...
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a financial services provider, your business is impacted by two of the strictest federal regulations on record: the Sarbanes-Oxley Act and the Gramm-Leach-Bliley Act. Correctly implementing faxing into your organization to provide secure, real-ti…
Many of the companies I’ve worked with have embraced cloud solutions due to their desire to “get out of the datacenter business.” The ability to achieve better security and availability, and the speed with which they are able to deploy, is far grea…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question