麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁(yè) > OS > Windows > 正文

windows命令行一些常見(jiàn)問(wèn)題

2024-06-28 16:03:49
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
帶空格的路徑 如果命令路徑有空格,需要加”“來(lái)運(yùn)行,否則會(huì)有“C:/PRogram”命令找不到的錯(cuò)誤。 經(jīng)常有一些程序的啟動(dòng)腳本寫(xiě)的不完善,需要自己去手動(dòng)去加“”在變量上。如果是需要在命令行中使用的命令,盡量單獨(dú)放在某目錄下,這樣可以最大程度減少路徑問(wèn)題引發(fā)的錯(cuò)誤。"C:/Program Files/java/jdk/bin/java" -version#或者cd C:/Program^ Filescd "%ProgramFiles%/batch.cmd"cd "%ProgramFiles(x86)%/batch.cmd"

2.junction 軟連接 A junction (also called a soft link) differs from a hard link in that the storage objects it references are separate directories, and a junction can link directories located on different local volumes on the same computer. Otherwise, junctions Operate identically to hard links. Junctions are implemented through reparse points.

C:/Windows/system32>mklink /J "C:/Program_Files" "C:/Program Files"# ouptut Junction created for C:/Program_Files <<===>> C:/Program Files

3.%~dp0的使用 - %0-9是輸入到batchfile的輸入?yún)?shù)占位符; - %后面跟一個(gè)~,可以在參數(shù)前加一個(gè)修飾符; - d表示驅(qū)動(dòng)器,如C、D盤符; - p表示當(dāng)前文件的路徑; 例如,新建一個(gè)test.bat

@echo offrem 打印當(dāng)前路徑,與%CD%效果相同pushd %~dp0../ #展開(kāi)當(dāng)前路徑并改變當(dāng)前路徑為上一層

引用stackoverflow上的一段解釋如下

The %~dp0 (that’s a zero) variable when referenced within a Windows batch file will expand to the drive letter and path of that batch file. The variables %0-%9 refer to the command line parameters of the batch file. %1-%9 refer to command line arguments after the batch file name. %0 refers to the batch file itself. If you follow the percent character (%) with a tilde character (~), you can insert a modifier(s) before the parameter number to alter the way the variable is expanded. The d modifier expands to the drive letter and the p modifier expands to the path of the parameter. Example: Let’s say you have a directory on C: called bat_files, and in that directory is a file called example.bat. In this case, %~dp0 (combining the d and p modifiers) will expand to C:/bat_files. And a more clear reference from here: %CmdCmdLine% will return the entire command line as passed to CMD.EXE %* will return the remainder of the command line starting at the first command line argument (in Windows NT 4, %* also includes all leading spaces) %~dn will return the drive letter of %n (n can range from 0 to 9) if %n is a valid path or file name (no UNC) %~pn will return the directory of %n if %n is a valid path or file name (no UNC) %~nn will return the file name only of %n if %n is a valid file name %~xn will return the file extension only of %n if %n is a valid file name %~fn will return the fully qualified path of %n if %n is a valid file name or directory

參考 windows命令索引 https://ss64.com/nt/ robvanderwoude’s Scripting Pages http://www.robvanderwoude.com/batchstart.php


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 欧美一级精品片在线看 | 99国产精品自拍 | 欧美在线 | 亚洲 | 欧美成人一区免费视频 | 欧美aⅴ视频 | 一级电影中文字幕 | 亚洲日本欧美 | www.精品久久 | 国产精品免费麻豆入口 | 56av国产精品久久久久久久 | 一区二区免费网站 | 性爱在线免费视频 | 日本黄色一级电影 | 色视频在线 | av国产片 | 国产 日韩 一区 | 一区二区三区日韩 | 91午夜在线观看 | 亚洲午夜在线 | 成人偷拍片视频在线观看 | 国产成人精品午夜视频' | 天堂成人国产精品一区 | 久久久久久69 | 7777视频 | www亚洲免费 | 羞羞视频免费网站 | 国产亚洲精品久久久久5区 男人天堂免费 | 成年片在线观看 | 久久精品国产久精国产 | 国产精品成人一区二区三区吃奶 | 成人免费福利视频 | 羞羞视频免费网站含羞草 | 毛片在线免费 | 久久成人激情视频 | 日本娇小videos高潮 | 日本在线精品视频 | 天天操天天碰 | 黄色网址进入 | 成人免费福利视频 | 久久精品国产99久久久古代 | 欧美18一12sex性处hd |