English 中文(简体)
Windows BAT如何替代驱动信件?
原标题:Windows BAT how to substitute drive letter?
  • 时间:2011-11-21 12:28:44
  •  标签:
  • batch-file

我正试图从我的umb泥中工作,因此,我正在把ava瓦安装在我自己的umb子里。 然而,这并不总是由总称为“G:”的PC来决定,有时可能是H或F,取决于目前有多少装置连接起来。

如何改写这场战斗,使之更有活力?

set Path=G:dev4 jdkjdk1.6.0_29in;%Path%

".dev1 ideeclipse-jee-indigo-SR1-win32eclipse.exe"

pause
最佳回答

The drive the file was started from is in %~d0 (%0 being the files full start path).
If the drive was G: then after double clicking the file in explorer, or running C:>G: he.bat then %~d0 === G:

因此,你可以;

set Path=%~d0dev4 jdkjdk1.6.0_29in;%Path%
问题回答

暂无回答




相关问题
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 ....

热门标签