English 中文(简体)
Windows batch是否有台式复印机短剪?
原标题:Is there a short cut for desktop folder in Windows batch?
  • 时间:2010-04-07 09:35:07
  •  标签:
  • batch-file
C:Documents and SettingsAdministratorDesktop

我不想每次打上上述字,以提及桌面上的一个档案。

问题回答

您可使用<条码>%USERPROFILE%Desktop>,但我不知道光盘的哪一种版本。

如果你想要real,那么台式的复印机在bach中就使用该代码。

for /F "skip=2 tokens=3* delims= " %%a in ( reg query "HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders" /v Desktop ) do set DesktopFolder="%%a"

这就需要提供reg(但我不知道有哪一种 Wind版),并将使Fo变。

set UserDesktop=%UserProfile%Desktop

if exist %Public% (
    set SharedDesktop=%Public%Desktop
) else (
    set SharedDesktop=%AllUsersProfile%Desktop
)

因此,现在你可以使用当地变量。

<>%UserDesktop%和% CommonDesktop%

共有的第一起案件是Vista,而其他案件是XP。

p.:在使用这些变量之前,你应当引用“%UserDesktop%”,因为用户名称必须拥有空间,如......Bill Gates...或Documents和情况......。





相关问题
complex batch replacement linux

I m trying to do some batch replacement for/with a fairly complex pattern So far I find the pattern as: find ( -name *.php -o -name *.html ) -exec grep -i -n hello {} + The string I want ...

How to split a string by spaces in a Windows batch file?

Suppose I have a string "AAA BBB CCC DDD EEE FFF". How can I split the string and retrieve the nth substring, in a batch file? The equivalent in C# would be "AAA BBB CCC DDD EEE FFF".Split()[n]

How to check which Operating System?

How can I check OS version in a batch file or through a vbs in an Windows 2k/2k3 environment ? You know ... Something like ... : "If winver Win2k then ... or if winver Win2k3 then ....

热门标签