C:Documents and SettingsAdministratorDesktop
我不想每次打上上述字,以提及桌面上的一个档案。
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变。
安德斯混合体可以是更为简单易读的,其方法如下:hybrid scripting by Tom Lavedas。
@if (@X)==(@Y) @goto :Dummy @end/* Batch part
@echo off
SETLOCAL ENABLEEXTENSIONS
for /f "delims=" %%x in ( cscript //E:JScript //nologo "%~f0" ) do set desk=%%x
echo desktop path is %desk%
goto :EOF
***** Now JScript begins *****/
WScript.Echo(WScript.CreateObject("Shell.Application").Namespace(16).Self.Path);
如果你绝对需要一个批量档案,但想利用窗户的描述能力,你不妨尝试一个
Batch/WSH 混合体:
@if (1==1) @if(1==0) @ELSE
@echo off&SETLOCAL ENABLEEXTENSIONS
for /f "delims=" %%x in ( cscript //E:JScript //nologo "%~f0" ) do set desk=%%x
echo desktop path is %desk%
@goto :EOF
@end @ELSE
WScript.Echo(WScript.CreateObject("Shell.Application").Namespace(16).Self.Path);
@end
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和情况......。
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 ...
I am trying to retrieve the environment variable to detect whether the system is 32 or 64 bit. But on 64 bit server the environment variable %processor_architecture% is returning x86 instead of AMD64. ...
IF %processor_architecture% == AMD64 (SET querypath=hklmsoftwarex) ELSE (SET dsetquerypath=hklmsoftwarey) FOR /F "tokens=* delims=" %%G IN ( REG QUERY "%querypath%" 2^>NUL ) DO ECHO %%G Let ...
I have a batch script that takes arguments from the command line. One of the arguments has a * in it. In spite of putting the argument in quotes, the * gets expanded before the argument gets used in ...
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]
Binary files have a version embedded in them - easy to display in Windows Explorer. How can I retrieve that file version, from a batch file?
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 ....
I don t know how to describe exactly what I m trying to do but here s an example batch file that demonstrates what I can t figure out.: I ve got a batch file. Inside that batch file I m trying to ...