|
|
|
bat-файлы. Параметр с пробелом.
|
|||
|---|---|---|---|
|
#18+
В a.bat производятся какие-то действия с заданным файлом: ..... "C:\abc\%1".... Вызываю этот батник с параметром: a.bat my file.txt Так, конечно, не катит, потому что есть пробел. Пишу так: a.bat "my file.txt" Получается "C:\abc\"my file.txt"", и возникает эскейп-последовательность \" ... Что делать? Хотелось бы в a.bat как-то отбросить кавычки от принятого параметра, но не знаю, как это сделать :( ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.06.2008, 11:47 |
|
||
|
bat-файлы. Параметр с пробелом.
|
|||
|---|---|---|---|
|
#18+
если параметр 1 то можно %0 The greatest programming project of all took six days; on the seventh day the programmer rested. We've been trying to debug the *&^%$#@ thing ever since. Moral: design before you implement. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.06.2008, 13:03 |
|
||
|
bat-файлы. Параметр с пробелом.
|
|||
|---|---|---|---|
|
#18+
[quot Anjey aka PM]если параметр 1 то можно %0 забудь, не то ляпнул ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.06.2008, 13:04 |
|
||
|
bat-файлы. Параметр с пробелом.
|
|||
|---|---|---|---|
|
#18+
Guest05062008 пишет: > В a.bat производятся какие-то действия с заданным файлом: > ..... "C:\abc\%1".... Внутри батника так писать НЕ НАДО, Если тебе надо выделять куски потей файлов и потом строить на их основе другие пути , пользуйся (цитата из хелпа, есть в каждой винде). Variable substitution Substitution modifiers for for variable references have been enhanced. The following table lists optional syntax (for any variable I). Variable with modifier Description %~I Expands %I which removes any surrounding quotation marks (""). %~fI Expands %I to a fully qualified path name. %~dI Expands %I to a drive letter only. %~pI Expands %I to a path only. %~nI Expands %I to a file name only. %~xI Expands %I to a file extension only. %~sI Expands path to contain short names only. %~aI Expands %I to the file attributes of file. %~tI Expands %I to the date and time of file. %~zI Expands %I to the size of file. %~$PATH:I Searches the directories listed in the PATH environment variable and expands %I to the fully qualified name of the first one found. If the environment variable name is not defined or the file is not found by the search, this modifier expands to the empty string. Posted via ActualForum NNTP Server 1.4 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.06.2008, 14:34 |
|
||
|
|

start [/forum/topic.php?fid=16&msg=35356010&tid=1345238]: |
0ms |
get settings: |
9ms |
get forum list: |
20ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
161ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
53ms |
get tp. blocked users: |
2ms |
| others: | 286ms |
| total: | 548ms |

| 0 / 0 |
