Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
バッチファイルに変数を作成し、この変数にテキストファイルのパスを割り当てたいと思います。その後、この変数を使用してそのファイルをコピーします。これどうやってするの?
ありがとうございました、
一般的な考え方は次のとおりです。
SET filename=c:\path\to\file.txt COPY "%filename%" c:\destination
引用符は次の点に注意してください%filename%。パスまたはファイル名にスペースが含まれている場合にコマンドを機能させるために必要です。
%filename%