xcopy

Running batch file with arguments from C#

别来无恙 提交于 2019-12-03 12:35:50
I have a batch file like this @echo off xcopy /e %1 %2 I have my C# code as follows: string MyBatchFile = @"C:\Program Files (x86)\MybatchFile.bat"; string _sourcePath = @"C:\FolderToCopy"; string _tempTargetPath = @"C:\TargetFolder\"; var process = new Process { StartInfo = { Arguments = string.Format("{0} {1}", _sourcePath, _tempTargetPath) } }; process.StartInfo.FileName = MyBatchFile; bool b = process.Start(); I expect this to copy the source files to target location. But nothing happens. My console window also does not stay for enough time so that I can see the error. Can anyone guide to

xcopy is not recognized as an internal or external command, operable program or batch file

匿名 (未验证) 提交于 2019-12-03 08:33:39
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem using 'xcopy' command. I'm building a C# project with msbuild. At the end of the build, a batch file is called to copy my assemblies from Debug/Release to some other folders. Here is the problem, my build fail and the error log is 'xcopy is not recognized as an internal or external command, operable program or batch file'. The path is correctly set, xcopy do works from a windows command line and from the visual studio command line (the one set with the project environment). I tried to set the path in the batch file but it

batch to copy files with xcopy

徘徊边缘 提交于 2019-12-03 07:39:41
I have checked some examples on internet but I can't get my (first) batch file to work. I would like to copy automatically my file from a folder to another one but nothing happen. @echo off xcopy "C:\source\" "C:\target\" /c /d /i /y exit Could you see anything wrong? Thanks!! Update: I have done the command given by Bali C but it still doesn't work. See snapshot xcopy C:\folder1 C:\folder2\folder1 /t /e /i /y xcopy C:\folder1 C:\folder2\ /t /e /i /y Image: I have to stop it with CTRL + C. PS: I'm on Win 7 Update (Solution): It works! The problem was the name xcopy,bat on my Desktop, and I was

XCOPY still asking (F = file, D = directory) confirmation

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My batch script xcopy is still asking F = file, D = directory confirmation even though I added /F in the script, log it is showing as below. Please help on the is how to avoid to asking confirmation. Script: net use p: /delete net use p: "\\200clan\F_Drive" /USER:adm /PERSISTENT:NO-1111 set source=%1 set target=p:/%2 echo %source% %target% xcopy /S /I /Q /Y /F "%source%" "%target%" Log: C:\test\foldera>xcopy /S /I /Q /Y /F "C:/test/folder1/folder2/logs/154/compareReport_177.html" "p:/Services/WSDLCompare/177_20151116/compareReport_177.html"

VS 2012: Post Build xcopy error 2

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i want to make VS copy the .lib-file it created after the build process to a specific folder. So i went to the project config, post-build event, and entered the following command: if exist $(TargetPath) xcopy "$(TargetPath)" "C:\Users\Incubbus\Documents\Visual Studio 2010\My Libraries\z.lib" /Y But instead of copying the process fails after i click "build" and i receive the following error: error MSB3073: The command "if exist C:\Users\Incubbus\Documents\Visual Studio 2010\My Libraries\MyNetWorkProject\Debug\IncNetworkLibD.lib xcopy "C:

xcopy file, rename, suppress “Does xxx specify a file name…” message

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This seems pretty simple and maybe I'm just overlooking the proper flag , but how would I, in one command, copy a file from one directory to another and rename it in the destination directory? Here's my command: if exist "bin\development\whee.config.example" if not exist "TestConnectionExternal\bin\Debug\whee.config" xcopy "bin\development\whee.config.example" "TestConnectionExternal\bin\Debug\whee.config" It prompts me with the following every time: Does TestConnectionExternal\bin\Debug\whee.config specify a file name or directory name on

DOS批处理命令---文件、分区复制(与ghost克隆功能一样)

匿名 (未验证) 提交于 2019-12-03 00:25:02
一、克隆工具: Ghost工具如下: 磁盘克隆: 1、磁盘克隆到另一个磁盘,会将被克隆磁盘数据覆盖。方法local→disk→to disk 2、磁盘写成镜像文件。方法local→disk→to image 3、GHO系统安装,镜像文件所在磁盘。方法local→disk→from image 分区(U盘)克隆:    Xcopy参数介绍 (注意命令xcopy可以将分区格式为fat克隆到fat/ntfs中,但ntfs不能克隆到fat中,会提示无效路径或者无法创建目录、参数错误等,只能ntfs克隆到ntfs中)    命令格式: XCOPY source [destination] 一堆可选的参数    参数介绍   source 指定要复制的文件。   destination 指定新文件的位置和/或名称。   /A 只复制有存档属性集的文件, 但不改变属性。   /M 只复制有存档属性集的文件, 并关闭存档属性。    /D:m-d-y 复制在指定日期或指定日期以后改变的文件。如果没有提供日期,只复制那些源时间比目标时间新的文件。   /EXCLUDE:file1[+file2][+file3]...   指定含有字符串的文件列表。如果有任何字符串与要被复制的文件的绝对路径相符,那个文件将不会得到复制。   例如,指定如 \obj\ 或 .obj 的字符串会排除目录 obj

ET框架分布式服务器部署

匿名 (未验证) 提交于 2019-12-03 00:15:02
前言:可能是大佬都觉得简单吧都没有详细的介绍(有介绍,可能是我太小白看不懂,哈哈哈),捉摸了一段时间把大佬们的文档记录下: 一、各服务器命名和作用(摘自:ET社区) 服务器名称 Manager : 对服务器进程进行管理Realm : 登录服务器 ( 验证账号密码 相当于LoginServer 祖传叫法,你想叫什么随你) Gate : 网关服务器 DB : 数据库服务器 Location : 位置服务器 Map : 地图服务器 Client : 客户端 All Server: 所有服务器集合 各服务器的作用(摘录自文档ET框架笔记): Manager:连接客户端的外网和连接内部服务器的内网,对服务器进程进行管理,自动检测和启动服务器进程。加载有内网组件NetInnerComponent,外网组件NetOuterComponent,服务器进程管理组件。自动启动突然停止运行的服务器,保证此服务器管理的其它服务器崩溃后能及时自动启动运行。 Realm:对Actor消息进行管理(添加、移除、分发等),连接内网和外网,对内网服务器进程进行操作,随机分配Gate服务器地址。内网组件NetInnerComponent,外网组件NetOuterComponent,Gate服务器随机分发组件。客户端登录时连接的第一个服务器,也可称为登录服务器。 Gate:对玩家进行管理,对Actor消息进行管理(添加

del/xcopy时如何在输出窗口中,不显示各个文件

匿名 (未验证) 提交于 2019-12-03 00:03:02
删除一个目录时,一下子输出很多文件,看了一点用也没有,其他地方反而看不到。怎么办? 这个时候,汝需要如下命令: del /q /s test > nul 同理,xcopy也可以如此使用。 来源:51CTO 作者: 柳鲲鹏 链接:https://blog.csdn.net/quantum7/article/details/100731241

批处理语句复制服务器或其他PC机内容到本地

匿名 (未验证) 提交于 2019-12-02 23:32:01
复制的前提条件: 1、被复制的内容做了共享; 2、知道远程访问共享的账户和用户名; 3、账户有权限对共享内容进行读取。 4、需要把复制的文件放在自己本地哪个位置。 在满足了上诉条件之后,我们开始来运行一段简单的代码: @echo off net use * /del /y --删除连接,避免多用户远程连接。 net use \200.200.200.240\桌面维护 /user: administrator admin@123 --使用已知的远程登录用户名、密码连接共享文件夹(\200.200.200.240\桌面维护 为共享文件夹) xcopy “\200.200.200.240\桌面维护\SQWallpaper\壁纸更换.bat” “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup” /s /s --该参数为复制目录或子目录,除了空的。在该语句中则表示只复制壁纸更换.bat 文件。其余参数详情可参照 xcopy命令参数使用介绍 :end @echo off SET COPYCMD=/Y net use * /del /y net use \\200.200.200.240\桌面维护 /user:administrator admin@123 xcopy "\\200.200.200.240\桌面维护