创建备份批处理文件来备份我的编程代码

发布于 2024-12-13 04:07:17 字数 367 浏览 1 评论 0原文

刚刚阅读了其他人一直在询问的有关批处理文件的问题,但找不到任何有用的东西。

我想使用批处理文件备份所有 C# 代码。请帮我找出我做错了什么?

这就是我要求我的批处理文件运行的内容:

copy C:\Visual Studio Express\Test Programs\Program 1\ c:\Backup Code\

每次我在谷歌上找到一些代码时,它都会显示如下内容:

copy C:\Fred\*.exe g:

现在这对我来说毫无用处,正如我尝试的那样,并且该代码中没有空格,就像我的一样。

如果您能帮助我,我将不胜感激。谢谢!

Just been reading through the questions that other people have been asking about batch files, and can't find anything useful.

I am wanting to backup all of my c# code, using a batch file. Please help me to find out what I am doing wrong?

This is what I am asking my batch file to run:

copy C:\Visual Studio Express\Test Programs\Program 1\ c:\Backup Code\

Everytime I find some code on google, it shows something like this:

copy C:\Fred\*.exe g:

Now that is useless to me, as I tried that, and that code has got no spaces in, like mine does.

If you can help me out, that would be greatly appreciated. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

吖咩 2024-12-20 04:07:17

尝试:

copy "C:\Visual Studio Express\Test Programs\Program 1\" "c:\Backup Code\"

也就是说,您可以在本地运行源代码控制存储库,请查看 本教程 了解有关如何设置“本地”SVN 源代码控制存储库的一些信息。这可以用作备份,并且具有为您提供备份历史记录的额外优势。

Try:

copy "C:\Visual Studio Express\Test Programs\Program 1\" "c:\Backup Code\"

That said, you can run a source control repository locally, take a look at this tutorial for some information on how to setup a "local" SVN source control repository. This can function as a backup and has the added advantage of giving you a history of backups.

甜味超标? 2024-12-20 04:07:17

只需在文件名周围使用引号即可:(

copy "C:\Visual Studio Express\Test Programs\Program 1\" "c:\Backup Code\"

尽管我认为您需要使用 xcopy 或复制 ...Program 1\*.* 才能正常工作)

另外,如果您可以忍受公开,备份源代码的更好方法是使用免费的版本控制系统,例如 GitHub:

https://github.com/

他们将允许你保留您的更改历史记录,并允许您回滚到以前的版本。这在某些时候会变得非常有帮助:)

Simply use quotes around your filenames:

copy "C:\Visual Studio Express\Test Programs\Program 1\" "c:\Backup Code\"

(though I think you'll want to use xcopy or copy ...Program 1\*.* for this to work properly)

Also, if you can stand it being public, a much better way to back up your source code is to use a free version control system, such as GitHub:

https://github.com/

They will allow you to keep a history of your changes, and allow you to roll back to previous versions. This will become very helpful at some point :)

っ左 2024-12-20 04:07:17

如果有空格,则必须将路径放在引号中:

copy "C:\Visual Studio Express\Test Programs\Program 1\" "c:\Backup Code\"

但是,您不应该复制项目,而应该真正考虑使用源代码管理系统,例如 SubversionGIT其他内容

You have to put your paths in quotes if you are having white spaces:

copy "C:\Visual Studio Express\Test Programs\Program 1\" "c:\Backup Code\"

But instead of copying your project you should really consider using a source code management system like Subversion, GIT or something else.

酒中人 2024-12-20 04:07:17

只需引用您的路径:

copy "C:\Visual Studio Express\Test Programs\Program 1\" "c:\Backup Code\"

我还建议您查看 xcopy 而不是复制。它允许一些更有用的操作。

Just quote your paths:

copy "C:\Visual Studio Express\Test Programs\Program 1\" "c:\Backup Code\"

I also recommend you to check out xcopy instead of copy. It allows some more useful operations.

沐歌 2024-12-20 04:07:17

您可能需要将包含空格的路径用 "" 括起来

copy C:\"Visual Studio Express"\"Test Programs"\"Program 1"\ c:\"Backup Code"\

You problably need to wrap paths that contains spaces with ""

copy C:\"Visual Studio Express"\"Test Programs"\"Program 1"\ c:\"Backup Code"\
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文