Show Current Working Folder or Directory Full Path in Batch Command Script Show actuel du dossier de travail ou d'un répertoire Full Path dans le premier lot de commandes de scripts

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. Lors de l'exécution d'un script de commande de lot (en. Cmd ou extension de fichier. BAT), il est parfois utile de connaître le répertoire courant du script batch. 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. Connaître le répertoire courant ou de dossier de travail de commande de lot est utile de veiller à ce que le script appelle la commande ou du programme en bonne voie, ou la manipulation des fichiers et des dossiers se fait à destination valide pour l'utilisation de chemins relatifs. Another important usage is to capture and save the current directory for later use, and the script may change the path during its course. Un autre usage important est de capturer et de sauvegarder le répertoire courant pour une utilisation ultérieure, et le script mai changer le chemin pendant son cours.

In fact, the showing and displaying of current directory is easy with the use of pseudo-variable for cmd.exe environment variables. En fait, la présentation et l'affichage du répertoire courant est facile avec l'utilisation de pseudo-variable pour les variables d'environnement cmd.exe. From Windows 2000 onwards, Microsoft Windows has added %CD% pseudo-variable that expands to the current working directory. Partir de Windows 2000, Microsoft Windows a ajouté pseudo% CD% variable qui élargit le répertoire de travail courant.

For example, to display current working directory, just use the following command: Par exemple, pour afficher le répertoire courant, il suffit d'utiliser la commande suivante:

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: Pour enregistrer et stocker le répertoire courant où un fichier se trouve pour une utilisation ultérieure après avoir changer de répertoire (cd) dans le dossier des autres pour effectuer d'autres opérations, utilisez les commandes suivantes:

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. Le% currentDir% variable pour stocker le répertoire de travail courant, qui peuvent être utilisés dans les commandes de commandes plus loin, ce qui change en revenir à ce répertoire précédent.

In Windows 9x, the %CD% pseudo-variable is not existed. Sous Windows 9x, le pseudo% CD% variable n'est pas existé. To get the current directory, use the following trick: Pour obtenir le répertoire en cours, utilisez l'astuce suivante:

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. Le résultat final est une variable%% CD été renvoyé à la session traitement par lot qui contient le répertoire de travail courant.

IMPORTANT : The page is machine translated and provided "as is" without warranty. IMPORTANT: La page est traduit et machine fournis «tels quels», sans garantie. Machine translation may be difficult to understand. La traduction automatique mai être difficile à comprendre. Please refer to S'il vous plaît se référer à original English article Article original en anglais whenever possible. mesure du possible.


Leave a Reply Laissez une réponse

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> Vous pouvez utiliser ces tags: fete_christel <abbr titre=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <<q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Abonnez-vous aux commentaires a été désactivé. To receive notification of latest comments posted, subscribe to Pour recevoir la notification des derniers commentaires postés, abonnez-vous à My Digital Life Comments RSS feed My Digital Life Comments RSS Feed or ou register to receive s'inscrire pour recevoir new comments in daily email digest. nouveaux commentaires dans le courriel quotidien digérer.
Custom Search

New Articles Nouveaux Articles

Incoming Search Terms for the Article Scruter Les terms pour un jour Article

batch current directory lot répertoire courant - -- bat current directory BAT répertoire courant - -- dos batch current directory DOS répertoire lot en cours - -- batch file current directory fichier batch répertoire courant - -- batch current dir lot répertoire en cours - -- windows batch current directory Directory de Windows lot en cours - -- set working directory bat jeu de travail bat répertoire - -- batch current folder lot de dossier en cours - -- batch script current directory commandes de script de répertoire courant - -- dos current directory DOS répertoire courant - -- current path batch file chemin du fichier en cours de lot - -- windows batch current dir Windows Dir lot en cours - -- get current directory batch obtenir des lots répertoire courant - -- bat get current dir BAT obtenir répertoire en cours - -- batch script get current directory script batch obtenir le répertoire courant - -- bat current folder BAT dossier en cours - -- dos batch current path DOS chemin lot en cours - -- bat script current directory bat script répertoire courant - -- dos bat current directory bat dos répertoire courant - -- bat current dir BAT répertoire en cours - -- current path cmd chemin courant cmd - -- batch file full path fichier de chemin d'accès complet - -- batch show directory lot afficher le contenu - -- set working directory batch jeu de travail par lots répertoire - -- dos current path DOS chemin courant - -- current directory batch file actuelle répertoire de fichiers batch - -- dos current folder dos dossier en cours - -- working directory batch répertoire de travail par lots - -- .bat current directory . BAT répertoire courant - -- batch change working directory Changement groupé répertoire de travail - -- batch current working directory lot répertoire de travail actuel - -- current directory batch Répertoire lot en cours - -- get current path dos obtenir dos chemin courant - -- windows BAT current dir Windows BAT répertoire en cours - -- current working directory bat répertoire de travail actuel chauve-souris - -- windows batch get current dir fenêtres batch obtenir répertoire en cours - -- get current directory in batch obtenir le répertoire courant en batch - -- dos batch current folder dos dossier de lot actuel - -- windows show working directory vitrines répertoire de travail - -- batch command to get current directory commande batch pour obtenir le répertoire courant - -- cmd current path cmd chemin courant - -- directory full répertoire complet - -- bat set working dir chauve-souris de jeu de travail dir - -- bat set current directory BAT mis répertoire courant - -- changing working directory in batch scripts changeant de répertoire de travail dans des scripts batch - -- dos batch full path DOS chemin lot complet - -- script ms dos current directory MS DOS script répertoire courant - -- dos batch working directory DOS Batch répertoire de travail - -- current path BAT BAT voie actuelle - -- dos get current path DOS obtenir le chemin courant - -- batch get current directory lot obtenir le répertoire courant - -- show directory command afficher le contenu de la commande - -- bat current working directory BAT répertoire de travail actuel - -- DOS command to get current DIR DOS commande pour obtenir DIR actuelle - -- batch working directory lot répertoire de travail - -- get current path in dos obtenir chemin courant dans le dos - -- Dos get current directory Dos obtenir le répertoire courant - -- batch current path lot chemin courant - -- echo current path in windows echo chemin courant sous Windows - -- windows batch "current directory" fenêtres batch "current directory" - -- windows batch current folder fenêtres de dossiers lot en cours - -- dos batch "current path" dos batch "chemin courant" - -- batch directory path lot de chemin de répertoire - -- display current directory afficher le répertoire courant - -- batch find current dir lot de trouver répertoire en cours - -- bat get current directory BAT obtenir le répertoire courant - -- batch current working folder lot de dossier de travail courant - -- use windows path in .bat scripts Windows utilisent chemin. bat scripts - -- batch set working directory lot ensemble de répertoire de travail - -- batch script get current dir script batch obtenir répertoire en cours - -- batch change directory lot de changer de répertoire - -- dos current dir path DOS chemin répertoire courant - -- dos current directory variable DOS variable répertoire courant - -- how to save current working directory comment sauvegarder le répertoire de travail courant - -- xp batch show current directory name XP lot montrent nom du répertoire courant - --