项目属性--生成事件--后期生成事件命令行

以开源记牌器https://github.com/Epix37/Hearthstone-Deck-Tracker 为例,Hearthstone Deck Tracker项目中的后期生成事件命令行:

 

if "$(ConfigurationName)" == "Release" (
rmdir /S /Q "..\Hearthstone Deck Tracker"
mkdir "..\Hearthstone Deck Tracker"
mkdir "..\Hearthstone Deck Tracker/Images"
mkdir "..\Hearthstone Deck Tracker/Files"
mkdir "..\Hearthstone Deck Tracker/Plugins"
xcopy /E /Y "Images\*.*" "..\Hearthstone Deck Tracker\Images"
xcopy /E /Y "Files\*.*" "..\Hearthstone Deck Tracker\Files"
xcopy /Y "HearthstoneDeckTracker.exe" "..\Hearthstone Deck Tracker"
xcopy /Y "HearthstoneDeckTracker.exe.config" "..\Hearthstone Deck Tracker"
ren "..\Hearthstone Deck Tracker\HearthstoneDeckTracker.exe" "Hearthstone Deck Tracker.exe"                            //重命名,目的是去掉空格
ren "..\Hearthstone Deck Tracker\HearthstoneDeckTracker.exe.config" "Hearthstone Deck Tracker.exe.config"         //重命名,目的是去掉空格
xcopy /Y "HDTHelper.exe" "..\Hearthstone Deck Tracker"
xcopy /Y "HDTUpdate.exe" "..\Hearthstone Deck Tracker"
xcopy /Y "HDTUninstaller.exe" "..\Hearthstone Deck Tracker"
xcopy /Y "HtmlAgilityPack.dll" "..\Hearthstone Deck Tracker"
xcopy /Y "MahApps.Metro.dll" "..\Hearthstone Deck Tracker"
xcopy /Y "Newtonsoft.Json.dll" "..\Hearthstone Deck Tracker"
xcopy /Y "System.Windows.Interactivity.dll" "..\Hearthstone Deck Tracker"
xcopy /Y "Version.xml" "..\Hearthstone Deck Tracker" )

 

rmdir 参数说明

/S 除目录本身外,还将删除指定目录下的所有子目录和文件。用于删除目录树。
/Q 安静模式,带 /S 删除目录树时不要求确认
mkdir 创建目录

xcopy 参数说明

xcopy /?

Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
[/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
[/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B] [/J]
[/EXCLUDE:file1[+file2][+file3]...]

source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies only files with the archive attribute set,
doesn't change the attribute.
/M Copies only files with the archive attribute set,
turns off the archive attribute.
/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
/EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings. Each string
should be in a separate line in the files. When any of the
strings match any part of the absolute path of the file to be
copied, that file will be excluded from being copied. For
example, specifying a string like \obj\ or .obj will exclude
all files underneath the directory obj or all files with the
.obj extension respectively.
/P Prompts you before creating each destination file.
/S Copies directories and subdirectories except empty ones.
/E Copies directories and subdirectories, including empty ones.
Same as /S /E. May be used to modify /T.
/V Verifies the size of each new file.
/W Prompts you to press a key before copying.
/C Continues copying even if errors occur.
/I If destination does not exist and copying more than one file,
assumes that destination must be a directory.
/Q Does not display file names while copying.
/F Displays full source and destination file names while copying.
/L Displays files that would be copied.
/G Allows the copying of encrypted files to destination that does
not support encryption.
/H Copies hidden and system files also.
/R Overwrites read-only files.
/T Creates directory structure, but does not copy files. Does not
include empty directories or subdirectories. /T /E includes
empty directories and subdirectories.
/U Copies only files that already exist in destination.
/K Copies attributes. Normal Xcopy will reset read-only attributes.
/N Copies using the generated short names.
/O Copies file ownership and ACL information.
/X Copies file audit settings (implies /O).
/Y Suppresses prompting to confirm you want to overwrite an
existing destination file.
/-Y Causes prompting to confirm you want to overwrite an
existing destination file.
/Z Copies networked files in restartable mode.
/B Copies the Symbolic Link itself versus the target of the link.
/J Copies using unbuffered I/O. Recommended for very large files.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy

/E 复制目录和子目录,包括空的。与 /S /E 相同。可以用来修改 /T。
Copies all subdirectories, even if they are empty. Use /e with the /s and /t command-line options.
/S 复制目录和子目录,除了空的。
Copies directories and subdirectories, unless they are empty. If you omit /s, xcopy works within a single directory.
/T 创建目录结构,但不复制文件。不包括空目录或子目录。/T /E 包括空目录和子目录。
Copies the subdirectory structure (that is, the tree) only, not files. To copy empty directories, you must include the /e command-line option.
/Y 复制文件审核设置(隐含 /O)。现存目标文件。【就是直接覆盖——Three~注】             这个似乎更准确:禁止提示以确认改写一个现存目标文件。
Suppresses prompting to confirm that you want to overwrite an existing destination file.
/D:m-d-y 复制在指定日期或指定日期以后更改的文件。如果没有提供日期,只复制那些源时间比目标时间新的文件。
/d [:MM-DD-YYYY]
Copies source files changed on or after the specified date only. If you do not include a MM-DD-YYYY value, xcopy copies all Source files that are newer than existing Destination files. This command-line option allows you to update files that have changed.

ren是rename的缩写,如果需要给文件重命名,可使用rename命令。

语法:rename<旧文件名><新文件名>
=======================

rmdir /S /Q "..\IntelligentBuilding"
mkdir "..\IntelligentBuilding"
xcopy /Y "AxInterop.SliderExLib.dll" "..\IntelligentBuilding"
xcopy /Y "ClientApp.exe" "..\IntelligentBuilding"
xcopy /Y "ClientApp.exe.config" "..\IntelligentBuilding"
xcopy /Y "DevExpress.BonusSkins.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Charts.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Data.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Office.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Pdf.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Pdf.v16.1.Drawing.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Printing.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.RichEdit.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Sparkline.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Utils.v16.1.UI.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.Utils.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraBars.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraCharts.v16.1.UI.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraCharts.v16.1.Wizard.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraCharts.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraEditors.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraGauges.v16.1.Core.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraGauges.v16.1.Win.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraGrid.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraLayout.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraNavBar.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraPrinting.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraRichEdit.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraTreeList.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "DevExpress.XtraVerticalGrid.v16.1.dll" "..\IntelligentBuilding"
xcopy /Y "Interop.SliderExLib.dll" "..\IntelligentBuilding"
xcopy /Y "log4net.dll" "..\IntelligentBuilding"

 

实战

现在有一个hotfix文件夹,5.1.0.0 Hotfix。在这个文件夹下有2个子文件夹

hotfix_5.1.1_Generic_20180911  这个子文件夹下有一些module文件夹

hotfix_5.1.2_Generic_20180912   这个子文件夹是新创建的,现在需要把上面的子文件夹的folder复制到这个子文件夹

在hotfix_5.1.1_Generic_20180911文件夹中执行命令

 xcopy /t . ..\hotfix_5.1.2_Generic_20180912\

xcopy /t . '..\..\5.1.0.0 Hotfix\hotfix_5.1.2_Generic_20180912\'  这个命令执行失败,提示说,创建目录失败。

 

谷歌查询之后,发现可以通过powershell的copy-item命令来操作

https://stackoverflow.com/questions/44678962/how-to-copy-folder-structure-only-with-powershell

 

 

 

转载于:https://www.cnblogs.com/chucklu/p/4772184.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/431422.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

大连理工优化方法matlab,大连理工大学2016年秋季优化方法大作业.pdf

优化方法期末上机大作业姓 名&#xff1a;李岚松学 部&#xff1a;电信学部电气工程学 号2016 年 11 月 9 日1最速下降法//最速下降法主函数//function llsdi1titidu(x)di1titidu(x)x0x; eps1e-4; k0; g0g(x0); s04; k0; g0g(x0); s0-g0;while (k>0)if norm(g0)break;elsela…

查看租户情况

source /root/openrc 查看keystone租户 keystone tenant-list 已知租户ID&#xff0c;获取租户名称 keystone tenant-get 5d95a18b92834ef2ada3abcf8eff1c83 查看某租户的配额及使用情况 # nova absolute-limits –-tenant ac9e6a9f-58c(租户ID)&#xff08;输出的内容不准确&a…

stm32 485和232可以用同一个串口吗_STM32的复用时钟何时开启?

STM32的AFIO时钟真的是在开启引脚复用功能的时候开启吗&#xff1f;其实并不是~什么是复用&#xff1f;我们知道&#xff0c;STM32有很多外设&#xff0c;这些外设的外部引脚都是与GPIO共用的。我们可以通过软件来配置引脚作为GPIO引脚还是作为外设引脚。当引脚配置为外设引脚时…

matlab 0-100随机数,添加到100的随机数:matlab

我经常看到这样的错误&#xff1a;要用给定的和来生成随机数&#xff0c;我们只需要使用一个一致的随机集&#xff0c;并且只需对它们进行缩放。但是&#xff0c;如果你这样做的话&#xff0c;结果真的都是随机的吗&#xff1f;在两个维度上尝试这个简单的测试。生成一个巨大的…

url中#号的作用

url中#号的作用就是本页面位置跳转 比如这个url地址&#xff1a;http://www.aaaaa.com/index.html?ad34&mc#red red就是index.html页面的依哥位置 浏览器读取这个URL后&#xff0c;会自动将red位置滚动至可视区域 位置定义方式 <a name"red">cdsc</a&…

python访问mysql_python连接mysql

首先需要导入驱动模块打开cmd导入模块 pip install mysqldb(pymysql)python2.x版本--------->mysqldbpython3.x版本---------->pymysqlpython调用MySQL数据库总共五步1、导入模块(驱动) pymysql mysqldb2、获取连接 connect3、获取游标cursor4、执行sql execute 并且返回…

php左侧菜单栏递归代码,js实现左侧菜单栏递归循环遍历

首先html布局菜单jsonconst menuList [{title: 首页,key: /home},{title: UI,key: /ui,children: [{title: 按钮,key: /ui/buttons,},{title: 弹框,key: /ui/modals,},{title: Loading,key: /ui/loadings,},{title: 通知提醒,key: /ui/notification,},{title: 全局Message,key…

重定向IO

引用自&#xff1a;http://www.cnblogs.com/liunanjava/p/4307793.html 1.三个静态变量 java.lang.System提供了三个静态变量 System.in&#xff08;默认键盘&#xff09;System.out(默认显示器)System.errSystem提供了三个重定向方法2.重写向方法 System提供了三个重定向方法 …

python三维数据本地保存_如何将3D Python/NumPy数组保存为文本文件?

如果保存文件需要是“csv”样式的文本&#xff0c;则可以使用多个savetxt和loadtxt。关键是要知道这两个都可以以打开的文件作为输入。写作示例&#xff1a;In [31]: Anp.arange(3*2*4).reshape(3,2,4)In [32]: A # normal display as 3 blocks of 2d arrayOut[32]:array([[[ 0…

php 简析对象,PHP白盒审计工具RIPS源码简析

RIPS是一款对PHP源码进行风险扫描的工具&#xff0c;其对代码扫描的方式是常规的正则匹配&#xff0c;确定sink点&#xff1b;还是如flowdroid构建全局数据流图&#xff0c;并分析存储全局数据可达路径&#xff1b;下面就从其源码上略探一二。1、扫描流程分析其源码前&#xff…

投资股权众筹项目,至少需要关注6个方面

1.股权结构去工商局查看这个公司的股权结构&#xff0c;哪些人是股东&#xff0c;历史出资情况。工商局网站上有很多信息可以查看&#xff0c;我发现北京工商局网站上可以查看的信息比较全面&#xff0c;而上海的就很稀烂。 几个查询网站&#xff1a; 北京企业信用信息网 ht…

python支持gui编程_Python GUI编程完整示例

本文实例讲述了python gui编程。分享给大家供大家参考&#xff0c;具体如下&#xff1a;import osfrom time import sleepfrom tkinter import *from tkinter.messagebox import showinfoclass dirlist(object):def __init__(self, initdirnone):self.top tk()self.label lab…

左右伸缩_冬季装修为啥要留伸缩缝?等到天热地板开裂就晚了!合肥人注意下...

后台有粉丝问&#xff1a;冬天真的不适合做装修吗&#xff1f;假的&#xff0c;这句话不要再传了。每个季节都会有利有弊&#xff0c;只不过冬季施工过程中干燥的比较快&#xff0c;装修的时候对施工要求的更严格。就拿伸缩缝来说吧&#xff0c;冬天装修时不注意&#xff0c;等…

转折点(心得)

也许是刚开学不适应&#xff1f;反正就是心不静&#xff0c;给自己一天时间调整&#xff0c;马上好过来&#xff0c;加油!!!以后每天至少一道题&#xff0c;但是要是学到东西的题&#xff0c;加油&#xff01;合理安排&#xff0c;有条不紊&#xff01;转载于:https://www.cnbl…

php进入文件目录,php文件目录操作

新建文件1、先确定要写入文件的内容$content 你好;2、打开这个文件(系统会自动建立这个空文件)//假设新建的文件叫file.txt&#xff0c;而且在上级目录下。w表示‘写文件’&#xff0c;$fp下面要用到&#xff0c;表示指向某个打开的文件。$fp fopen(../file.txt, w);3、将内容…

python设计自定义栈类_Python如何自定义模块?Python基础教程,第十讲,自定义模块...

学完此次课程&#xff0c;我能做什么&#xff1f;通过此次课程&#xff0c;我们将学会如何自定义自己的模块和包&#xff0c;以及如何引用到自己的项目中&#xff0c;从而实现代码的复用。学习此次课程&#xff0c;需要多久&#xff1f;5-10分钟课程内容什么是Python的标准库&a…

windows.h和winsock2.h包含顺序问题(转)

windows.h和winsock2.h有类型重定义我是知道的&#xff0c;本来就一个库来说没问题&#xff0c;把winsock2放到windows.h前或先定义WIN32_LEAN_AND_MEAN都能解决问题但现的出了问题&#xff0c;自己写的一个库里要用到ws2tcpip&#xff0c;这个头文件第一个包含的头文件就是win…

java中软填空面试题,通过这9个Java面试题,就可以入职华为啦

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼1&#xff0e;Java程序的种类有(BCD )A&#xff0e;类(Class) B&#xff0e;Applet C&#xff0e;Application D&#xff0e;Servlet2&#xff0e;下列说法正确的有( BCD)A&#xff0e; 环境变量可在编译source code时指定B&#x…

红色警戒2修改器原理百科(七)

&#xff08;十五&#xff09;科技全开——前方高能&#xff0c;BOOM 其实这一小节&#xff0c;最晚应该在第四篇的十小节来讲述的&#xff0c;这样是按照一条线索来讲的&#xff0c;容易理解和把握笔者修改时的思路&#xff0c;以一点逐渐扩大。由于笔者的一些原因&#xff08…

python两个线程交替打印_三线程按顺序交替打印ABC的四种方法

建立三个线程A、B、C&#xff0c;A线程打印10次字母A&#xff0c;B线程打印10次字母B,C线程打印10次字母C&#xff0c;但是要求三个线程同时运行&#xff0c;并且实现交替打印&#xff0c;即按照ABCABCABC的顺序打印。二、Synchronized同步法1、基本思路使用同步块和wait、noti…