<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									File Copy Over Network - Website Updates				            </title>
            <link>https://www.tweaking4all.com/forum/website-updates/file-copy-over-network/</link>
            <description>Tweaking4All.com Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Sat, 09 May 2026 21:04:40 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: File Copy Over Network</title>
                        <link>https://www.tweaking4all.com/forum/website-updates/file-copy-over-network/#post-3402</link>
                        <pubDate>Fri, 30 Apr 2021 10:27:28 +0000</pubDate>
                        <description><![CDATA[I very much suspect that authorization fails, and that&#039;s why I doesn&#039;t work.As I understand, you cannot add username/password in the URI (under Windows), so that won&#039;t be a solution either....]]></description>
                        <content:encoded><![CDATA[<p>I very much suspect that authorization fails, and that's why I doesn't work.<br />As I understand, you cannot add username/password in the URI (under Windows), so that won't be a solution either.</p>
<p>I haven't done any C++/C# programming under Windows in the passed years. So I can only ask our friend Google.</p>
<p>I did find <a href="https://social.msdn.microsoft.com/Forums/vstudio/en-US/ffebef9c-a063-46e6-8307-2f73bbf688b7/copy-a-file-to-shared-network-location-with-c?forum=csharpgeneral" target="true">this post</a>, maybe it helps.</p>
<p>As I understand this sets your current "user" to the user you need to be able to access the file (credentials not the same as your current user account):</p>
<pre contenteditable="false">AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);

WindowsIdentity idnt = new WindowsIdentity(username, password);

WindowsImpersonationContext context = idnt.Impersonate();

File.Copy(@"\\192.100.0.2\temp", @"D:\WorkDir\TempDir\test.txt", true);

context.Undo();</pre>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/website-updates/">Website Updates</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/website-updates/file-copy-over-network/#post-3402</guid>
                    </item>
				                    <item>
                        <title>RE: File Copy Over Network</title>
                        <link>https://www.tweaking4all.com/forum/website-updates/file-copy-over-network/#post-3401</link>
                        <pubDate>Thu, 29 Apr 2021 22:00:13 +0000</pubDate>
                        <description><![CDATA[@hans Hello Hans,
Thank you for your replying!
i&#039;m working with
Language : c++
OS : window 10
development environment : Rad studio
we have a network drive and need an authentication.
...]]></description>
                        <content:encoded><![CDATA[<p>@hans Hello Hans,</p>
<p>Thank you for your replying!</p>
<p>i'm working with</p>
<p>Language : c++</p>
<p>OS : window 10</p>
<p><span>development environment : Rad studio</span></p>
<p>we have a network drive and need an authentication.</p>
<p>I'm trying to copy the file from network drives to local drive.</p>
<p> thank you,</p>
<p> </p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/website-updates/">Website Updates</category>                        <dc:creator>tjsah18</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/website-updates/file-copy-over-network/#post-3401</guid>
                    </item>
				                    <item>
                        <title>RE: File Copy Over Network</title>
                        <link>https://www.tweaking4all.com/forum/website-updates/file-copy-over-network/#post-3393</link>
                        <pubDate>Wed, 28 Apr 2021 10:48:55 +0000</pubDate>
                        <description><![CDATA[Hi Tjsah18,
what language and development environment are you working with? (looks like a C variant, C# maybe??)I presume you&#039;re running something under Windows (drive letters are only used...]]></description>
                        <content:encoded><![CDATA[<p>Hi Tjsah18,</p>
<p>what language and development environment are you working with? (looks like a C variant, C# maybe??)<br />I presume you're running something under Windows (drive letters are only used under Windows).</p>
<p>There can be a lot of reasons why this doesn't work.<br />Does the server need some kind of authentication? <br />As far as I remember, most do need some sort of authentication - to avoid this, map the network share as a drive (I could be wrong of course).</p>
<p>Note: I've ran into the same issue with different programming languages.</p>
<p>p.s. I created a new sub-forum for questions like yours, so I moved it there since that seemed more appropriate.</p>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/website-updates/">Website Updates</category>                        <dc:creator>Hans</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/website-updates/file-copy-over-network/#post-3393</guid>
                    </item>
				                    <item>
                        <title>File Copy Over Network</title>
                        <link>https://www.tweaking4all.com/forum/website-updates/file-copy-over-network/#post-3391</link>
                        <pubDate>Wed, 28 Apr 2021 00:02:45 +0000</pubDate>
                        <description><![CDATA[I&#039;ve been trying to make a program that copies files through network.
I don&#039;t know why but String source = L&quot;E:\\Outputs\\083\\jpERP.exe&quot;;          //==&gt; OK! is working but the other did...]]></description>
                        <content:encoded><![CDATA[<div><span>I've been trying to make a program that copies files through network.</span></div>
<div>I don't know why but String source = L"E:\\Outputs\\083\\jpERP.exe";          //==&gt; OK! is working but the other didn't work.</div>
<div>there are no error, not copied. so it's hard to find the problem.</div>
<div>is there any ideas i can solve this problem?</div>
<div>
<pre contenteditable="false">bool __fastcall TdlgMain::ft_Copy_CopyFile(void)
{
   // need username, password ????
   String source = L"\\\\rs-fs1\\jpDataXE\\jpERP.exe";     // ==&gt; No error, Not copied
//   String source = L"E:\\Outputs\\083\\jpERP.exe";          //==&gt; OK!
//   String source = L"Z:\\jpERP.exe";          //==&gt; Not copied !
   String destin = L"C:\\RS Programs\\jpERP.exe";
   int result;


   if(FileExists(source))
   {
       ShowMessage(L"Found: " + source);
       try{
           result = CopyFile(source.w_str(), destin.w_str(), true);
           ShowMessage(GetLastError());
           if(result)
               ShowMessage(L"Success");
           else
               ShowMessage(L"Failed");
       }
       catch(...){
           ShowMessage(L"CopyFile  - error");
       }
   }
   else{
       ShowMessage(L"No file found...");
       return false;
   }


   return true;
}</pre>
</div>]]></content:encoded>
						                            <category domain="https://www.tweaking4all.com/forum/website-updates/">Website Updates</category>                        <dc:creator>tjsah18</dc:creator>
                        <guid isPermaLink="true">https://www.tweaking4all.com/forum/website-updates/file-copy-over-network/#post-3391</guid>
                    </item>
							        </channel>
        </rss>
		