バッチ ファイルを使用していて、それをバッチと同じディレクトリにあるフォルダーに転送したいとします。私が間違っていなければ、「%~dp0\whateverfoldername」と書きます。しかし、「.\whateverfoldername」と書くだけでは同じことができないのでしょうか? もしそうなら、それぞれのコマンドの違いや利点は何ですか?
34255 次
2 に答える
3
".\ will locate with respect to the CURRENT directory, hence if you have changed directories with a CD command then you will be looking at THAT directory, not the directory in which the batch resides.
In fact, it's normal to create a separate directory, often called \batch or perhaps \belfry to keep batch files. Provided the ,bat in question is locared on the path, it will be located. %dp0 will yield the location of the .bat.
于 2013-04-08T23:59:17.557 に答える