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.
Related Articles Artikel Terkait
- Open Elevated Command Prompt Window Here as Administrator at Current Folder Directly in Vista Windows Explorer Peningkatan Buka Command Prompt Window Di sini sebagai Administrator pada Folder Aktif Tepat di Vista Windows Explorer
- Script to Backup Current Start State (Startup Type) of Windows Services Script untuk Backup Buat halaman ini Negara (Startup Type) dari Windows Services
- Windows Vista and Server 2008 Services Optimization (with Batch Command Script Optimizer) Windows Vista dan Server 2008 Layanan Optimization (dengan Batch Command Script Optimizer)
- Reveal and Access to Windows Vista Hidden Context-Sensitive (Right Click) Menu Item – Open Command Prompt Here & Copy as Path Mengungkapkan dan Akses ke Windows Vista Tersembunyi Context-Sensitive (Right Click) Menu Item - Buka Command Prompt Here & Salin sebagai Path
- Reveal, Copy and Get File Full Path with Copy as Path in Windows Vista Mengungkapkan, Salin dan Get File Kendali Path dengan Salinan Path pada Windows Vista
- TimerLock Automated Batch Install Script for TimerStop Driver v2a and Windows Vista Activation 2099 Crack Automated TimerLock Batch Script untuk TimerStop Instal Driver v2a dan Windows Vista Activation Crack 2099
- Automatically Expand Navigation Pane Tree to Current Folder in Windows 7 Expand secara otomatis Pane Navigasi Pohon to Current Folder di Windows 7
- How To Mount and Access New Partition, Volume or Drive As Folder Path In Windows Cara Gunung dan Akses Partisi Baru, Volume atau Drive Sebagai Path Folder Pada Windows
- Add Open Command Window Here to XP Folder with PowerToy Tambahkan Open Command Window Here to XP Folder dengan PowerToy
- Vista IE7 Cache & Cookies Folder, Temp Directory and History Location Vista IE7 Cache & Cookies Folder, Temp Directory dan Sejarah Lokasi









































