Jump to content

[CMD] How to perform up one level


Recommended Posts

Posted (edited)

Hi all,

I wanna to know how i can make up one level using cmd script as i have .cmd file and i wanna it to search for file reside in folder one level form the folder where .cmd in

Main folder
|___ Folder 1
|___ .cmd file
|___ Folder 2
|___ file required to check for it.

btw, the path for Main folder get changed from user to another.

How this action done?!

Edited by xtremee

Posted

. -> refers to the current folder

.. -> refers to the parent folder

so 'cd .' leaves you in your current folder 'cd ..' takes you up one level. Also works for running commands, reeferencing files etc.

..\myexe.exe

runs myexe.exe out of parent folder

..\..\goaway.bat

runs goaway.bat from folder two levels up

showit ..\bestpic.jpg

runs showit and loads bestpic.jpg from folder one level up.

Best practice go live on a dos 6.22 machine for awhile without windows 3.1x you'll catch on quickly. :)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...