外壳:通用启动作为参数传递给XCOPY [英] shell:Common Startup as a parameter to XCOPY

查看:108
本文介绍了外壳:通用启动作为参数传递给XCOPY的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的批处理脚本,将文件复制到启动文件夹,但现在看来,我不能使用shell:通用启动作为参数传递给XCOPY。我曾经尝试这样做

I have a simple batch script that copies a file to the startup folder, but it appears that I can't use shell:Common Startup as a parameter to xcopy. I have tried this

xcopy hurrdurr.exe "shell:Common Startup"

和许多其它变型,并且它们不工作。顺便说一句,如果没有工作,hurrdurr.exe将在每次启动时运行的权利,假设我通过UAC间隙做XCOPY操作?将使用环境变量不是更好吗?有问题的操作系统是Windows XP和程序。

and many other variations, and they don't work. As an aside, if this did work, "hurrdurr.exe" would run on every startup right, assuming I got clearance via uac to do the xcopy operation? Would using a environment variable be better? The os in question is Windows XP and proceeding.

推荐答案

我不知道为什么你的shell命令将无法正常工作,但如果你需要让你的程序在启动时那我就多$ P $加载使用注册表PFER,它的清洁,简单,它意味着你不必将文件复制在其他地方,尤其是如果该文件是依赖于其他的事情。

I'm not sure why your shell command won't work, but if you need to get your program to load on startup then I would much prefer using the registry, it's cleaner and simpler, and it means you don't have to copy the file somewhere else, especially if that file is dependant on other things.

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v "Hurrdurr" /d "hurrdurr.exe" /f

只要运行CMD作为管理员,也将努力:)

Just run cmd as admin and it will work :)

如果你想使用,虽然启动文件夹,Win7上可以使用

If you do want to use the startup folder though, on Win7 you can use

"%appdata%\Microsoft\Windows\Start Menu\Programs\Startup"

我也想使用快捷方式作为@大卫建议复制实际的文件,而不是。

I would also use a shortcut as @David suggested instead of copying the actual file.

这篇关于外壳:通用启动作为参数传递给XCOPY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆