Show Current Working Folder or Directory Full Path in Batch Command Script Tampilkan Current Bekerja Folder atau Direktori Kendali Path di Batch Command Script

When executing a batch command script (in .cmd or .bat file extension), sometimes it's useful to get to know the current working directory of the batch script. Ketika menjalankan perintah batch script (dalam. Cmd atau. Ekstensi file bat), kadang-kadang berguna untuk mengetahui direktori kerja saat ini bets script. Knowing the current directory or working folder in batch command is useful to ensure that the script is calling command or program at correct path, or manipulation of file and folder is done at valid destination when using relative path. Mengetahui direktori sekarang atau bekerja folder dalam perintah batch ini berguna untuk memastikan bahwa script yang memanggil perintah atau program pada jalur yang benar, atau manipulasi file dan folder tujuan yang valid dilakukan pada saat menggunakan path relatif. Another important usage is to capture and save the current directory for later use, and the script may change the path during its course. Penggunaan penting lainnya adalah untuk menangkap dan menyimpan direktori saat ini untuk kemudian digunakan, dan script dapat mengubah jalan selama kursus.

In fact, the showing and displaying of current directory is easy with the use of pseudo-variable for cmd.exe environment variables. Dalam kenyataannya, menunjukkan dan menampilkan direktori saat ini mudah dengan penggunaan pseudo-variabel untuk variabel lingkungan cmd.exe. From Windows 2000 onwards, Microsoft Windows has added %CD% pseudo-variable that expands to the current working directory. Dari Windows 2000 dan seterusnya, Microsoft Windows telah menambahkan% CD% pseudo-variabel yang memperluas ke direktori kerja saat ini.

For example, to display current working directory, just use the following command: Sebagai contoh, untuk menampilkan direktori kerja saat ini, cukup gunakan perintah berikut:

Echo %CD% Echo% CD%

To save and store the current directory where a file is located for later use after change directory (cd) to other folder to perform other operations, use the following commands: Untuk menyimpan dan menyimpan direktori saat ini di mana file tersebut berada untuk kemudian digunakan setelah perubahan direktori (cd) ke folder lain untuk melakukan operasi lain, gunakan perintah berikut:

Set CURRENTDIR=%CD%

The %CURRENTDIR% variable to store the current working directory, which can be used in later batch commands, which as changing back to this previous directory. The% CURRENTDIR% variabel untuk menyimpan direktori kerja saat ini, yang dapat digunakan di kemudian batch perintah, yang saat ini berubah kembali ke direktori sebelumnya.

In Windows 9x, the %CD% pseudo-variable is not existed. Pada Windows 9x, yang% CD% pseudo-variabel ini tidak ada. To get the current directory, use the following trick: Untuk mendapatkan direktori saat ini, gunakan trik berikut:

CD | Time | Find ":\" > Temp1.Bat
Echo Set CD=%%4 %%5 %%6 %%7 %%8 %%9 > Enter.Bat
Call Temp1.Bat
Del Temp1.Bat
Del Enter.Bat

The end result is a variable %CD% been returned to the batch processing session which contains the current working directory. Hasil akhirnya adalah sebuah variabel% CD% sudah dikembalikan ke proses batch sesi yang berisi direktori kerja saat ini.

IMPORTANT : The page is machine translated and provided "as is" without warranty. PENTING: Halaman ini adalah mesin diterjemahkan dan diberikan "sebagaimana adanya" tanpa jaminan. Machine translation may be difficult to understand. Terjemahan mesin mungkin sulit untuk mengerti. Please refer to Silakan merujuk ke original English article artikel asli bahasa Inggris whenever possible. bila memungkinkan.


Leave a Reply Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Anda dapat menggunakan tag ini: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Berlangganan ke fitur komentar telah dinonaktifkan. To receive notification of latest comments posted, subscribe to Untuk menerima pemberitahuan dari komentar terbaru diposting, untuk berlangganan My Digital Life Comments RSS feed My Digital Life Komentar RSS feed or atau register to receive mendaftar untuk menerima new comments in daily email digest. komentar baru di email digest harian.
Custom Search

New Articles Artikel Baru

Incoming Search Terms for the Article Cari Syarat masuk untuk Artikel

batch current directory batch direktori saat - -- dos get current directory dos mendapatkan direktori saat - -- dos show current directory dos menampilkan direktori saat - -- current directory windows direktori saat jendela - -- display current dir in dos saat ini menampilkan dir dalam dos - -- batch get current directory batch mendapatkan direktori saat - -- batch working directory batch direktori kerja - -- current directory batch file direktori sekarang file batch - -- echo current path echo lintasan arus - -- get path of current folder windows xp mendapatkan path dari folder yang aktif windows xp - -- how to get current path in dos bagaimana untuk mendapatkan lintasan arus dalam dos - -- batch file get current path file batch mendapatkan lintasan arus - -- cmd current path cmd lintasan arus - -- cmd current directory cmd direktori saat - -- dos find current directory name dos menemukan nama direktori saat - -- windows bat file current path jendela file kelelawar lintasan arus - -- windows commands for path of current file jendela perintah untuk jalan file saat ini - -- "Directory.Current Directory()" "Directory.Current Directory ()" - -- batch set working directory variable batch mengatur variabel direktori kerja - -- change directory windows batch script jendela direktori mengubah batch script - -- CMD hide full dir CMD menyembunyikan dir penuh - -- copy file current map cmd menyalin berkas peta saat cmd - -- dos path current jalan dos saat - -- dos current folder dos folder aktif - -- dos batch change working dir perubahan batch dos bekerja dir - -- get script batch OR bat current path mendapatkan script batch ATAU kelelawar lintasan arus - -- get current path in a bat file mendapatkan lintasan arus dalam file kelelawar - -- Get Current Directory Path Get Current Directory Path - -- get current directory windows script cd mendapatkan direktori aktif cd windows script - -- print working directory not fullpath mencetak direktori kerja tidak fullpath - -- show complete path when i open a folder menunjukkan jalur lengkap ketika saya membuka folder - -- windows 7 show fullpath windows 7 menunjukkan fullpath - -- WINDOWS 7 DISPLAY FULL PATH WINDOWS 7 DISPLAY FULL PATH - -- bat cd current cd kelelawar saat - -- bat file get current directory file kelelawar mendapatkan direktori saat ini - -- batch + this directory bets + direktori ini - -- bat work directory kelelawar direktori kerja - -- cmd show directories cmd menunjukkan direktori - -- display current directory in dos menampilkan direktori saat ini di dos - -- dos command prompt batch get current directory dos command prompt batch mendapatkan direktori saat - -- dos batch get currecnt directory name dos batch mendapatkan nama direktori currecnt - -- fullpath preloz fullpath preloz - -- get the latest directory batch mendapatkan direktori terbaru bets - -- How to get the current directory in script Cara mendapatkan direktori saat ini dalam aksara - -- open current user folder batch buka folder pengguna saat ini bets - -- shoq current directory dos command direktori saat ini shoq perintah dos - -- show full file path windows 7 menunjukkan path file lengkap windows 7 - -- show full path windows 7 menunjukkan path lengkap windows 7 - -- show path script menunjukkan jalur script - -- vista bat current directory variable vista kelelawar direktori aktual variabel - --