file-copying

copy file to remote desktop drive

眉间皱痕 提交于 2019-12-05 19:43:42
I want to copy a file from my local C:\filename.png to the remote computer to which I am connected via remote desktop's C:\ drive. Is it possible to copy using powershell or anyother terminal command? I am using windows 7 (local PC) --- Remote Desktop (Windows Server 2003) Thomas Lee If your host's c: drive is injected into a terminal services session, it just gets a new drive letter in the remote session. On my network, my host machine's drives are injected into a VM and C: becomes M:. So in that case, in the remote session: copy c:\file.png m:\png BUt perhaps a beter way - from your host:

Copying a file to a network share which I don't have access to

旧巷老猫 提交于 2019-12-05 13:35:40
This is an extension of this question I am trying to copy a file from my local user's temp folder to a remote file share. I do not have access to the remote file share, so I have to impersonate a user who does. Now, I can successfully read a file from the remote server and copy it locally, however I cannot write a local file to the share, since it gives me the error: Access denied for the LOCAL file (as I am now impersonating another user). If you need some code I can post it. Managed to find the answer, I simply had to create a FileStream to the local file BEFORE impersonating the remote user

How to copy one file to many locations simultaneously

别等时光非礼了梦想. 提交于 2019-12-05 09:53:21
I want to find a way to copy one file to multiple locations simultaneously (with C#). means that i don't want the original file to be read only one time, and to "paste" the file to another locations (on local network). as far as my tests showed me, the File.Copy() will always read the source again. and as far as i understand, even while using memory, that memory piece gets locked. so basically, i want to mimic the "copy-paste" to the form of one "copy", and multiple "paste", without re-reading from the Hard Drive again. Why ? because eventually, i need to copy one folder (more than 1GB) to

How to write a call back function for ignore in shutil.copytree

不羁岁月 提交于 2019-12-05 03:32:18
I am relatively new to python. I am trying to copy a directory to another directory maintaining the structure. I am using shutil.copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False) I am trying to write a call back function for ignore. My aim is to take a list of files in a list , and copy only those files,ignoring the rest. How do we pass a list into the call back function? I wrote a simple call back function , but I get some error when I try to run the copyTree function def abc(src,names): print(src) print(names) Traceback (most recent call

Lazarus & Free Pascal - How to recursively copy a source directory of files to another directory?

≡放荡痞女 提交于 2019-12-04 19:12:42
I need to add some functionality to my Lazarus & Free Pascal GUI program - I need it to also copy files from a users chosen dir to another dir. I have a "Choose Source" TSelectDirectoryDialog button onclick event for the source directory and a "Choose Destination" TSelectDirectoryDialog button onclick event for the destination dir. I have a 3rd button to do the copying from Source to Destination. So far, I have found CopyFile that copies the files and the original date attributes, but it doesn't recreate the subdirectory structure of any subdirectories of the users chosen source directory. I

Copy file even when destination exists (in Qt)

不羁岁月 提交于 2019-12-04 15:46:13
问题 In the QFile::copy documentation it says If a file with the name newName already exists, copy() returns false (i.e., QFile will not overwrite it). But I need to copy a file even if the destination exists. Any workaround available in Qt for that? Deleting the file is the obvious solution but it invites a race condition... 回答1: if (QFile::exists("/home/user/dst.txt")) { QFile::remove("/home/user/dst.txt"); } QFile::copy("/home/user/src.txt", "/home/user/dst.txt"); 回答2: The obvious solution is

Semaphore timeout period has expired

无人久伴 提交于 2019-12-04 10:21:05
I have a simple C# program that copies files from one network share to another. The program just threw a "The semaphore timeout period has expired" error. I've never seen this before and I'm kind of confused as to what it is. The code is pretty simple: (srcPath and destPath are read from configuration settings) DirectoryInfo di = new DirectoryInfo(srcPath); try { FileInfo[] files = di.GetFiles(); foreach (FileInfo fi in files) { if(!(fi.Name.Contains("_desc"))) { File.Copy(fi.FullName, destPath + fi.Name, true); } } } catch (Exception xx) { SendMail(xx.Message, xx.StackTrace); } finally { }

SAF - Invalid URI error from DocumentsContract.createDocument method (FileOutputStream copy)

∥☆過路亽.° 提交于 2019-12-04 05:50:24
问题 My app is migrating to SAF or, at least some experimentation is going about. Now it has to copy a file from private app folder to a SAF folder that was authorized. The used method is: static boolean copyFileToTargetFolderWithNewName(Activity activity, String filePath,String targetFolderUri,String newName) { File file = new File(filePath); FileInputStream fis=null; Uri docUri=null; try { fis=new FileInputStream(file); } catch (FileNotFoundException e) { return false; } deleteIfExisting

When copying files using Apps Script from one folder to another any “Apps Script” files being copied end up in MyDrive not the specified folder - why?

寵の児 提交于 2019-12-04 04:28:28
问题 I use this Apps Script to make backup copies of some files: var sourceFolderId = "xxxxxx"; var sourceFolder = DriveApp.getFolderById(sourceFolderId); var latestFiles = sourceFolder.getFiles(); var backupFolderId = "yyyyyy"; var backupFolder = DriveApp.getFolderById(backupFolderId); while(latestFiles.hasNext()) { var file = latestFiles.next(); file.makeCopy(backupFolder); } It works fine - copying all files from the source folder to the backup folder- except that if any file being copied is a

How can I copy/replace a DLL?

好久不见. 提交于 2019-12-04 03:22:49
I have a utility which updates applications by simply copying/replacing the executables. Now, I have some DLL files which need to be updated as well. However, sometimes Windows will not let me replace it because something is using it, and sometimes there's so many things using the DLL that I cannot guarantee it will be unlocked for me to replace it. Currently, my only work-around is to re-name the existing DLL first, and then I can copy the new one in its place. But then the old DLL gets left behind with an altered file name. How can I replace a DLL programatically in this situation? Your