Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 



xtremee

[CMD] How to perform up one level

Recommended Posts

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

Share this post


Link to post
Share on other sites

. -> 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. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

×