Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Window Dos Command?  (Read 3017 times)

0 Members and 1 Guest are viewing this topic.

Tictoc

  • Guest
Window Dos Command?
« on: January 04, 2008, 03:43:34 PM »
Has anyone ever seen the command .\ used in a batch file to move to the parent folder or can anyone tell me what this command mean?

Thanks,

diablo416

  • Guest
Re: Window Dos Command?
« Reply #1 on: January 05, 2008, 03:37:53 PM »
do you mean c:\...\MSN would mean c:\progra~1\MSN in win xp

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Window Dos Command?
« Reply #2 on: January 06, 2008, 02:23:47 PM »
.\  represents the current directory relative to the current path

..\ represents the parent directory

.\  is helpful in installation scripts and autorun files

 8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

Tictoc

  • Guest
Re: Window Dos Command?
« Reply #3 on: January 07, 2008, 08:49:13 AM »
sidewinder,
I am modifying a piece of software that is installed on a server. It works on the server as programmed but won't on my local PC with all the references path created. Is there some setting that need to be set before this command can be used?

Or can you give example of a script?

Thanks,

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Window Dos Command?
« Reply #4 on: January 07, 2008, 04:30:06 PM »
Actually ..\ is shorthand notation for moving up one directory level relative to your current location.

If your current path is c:\dir1\dir2\dir3 and you issue the cd ..\ command, your current path is now c:\dir1\dir2. While this can be useful at the command line, relative paths in batch files can be cryptic and very annoying to debug.

The .\ notation is good for installation scripts. .\ denotes the current directory.

If two people install the same application into two different directories, the install script can equate .\ to the application directory typed in by each user and proceed to build an entire directory structure under the install directory. Of course it's not quite that simple as the structure for install directory may have to be built (but you get the idea). By making the script generic each user can arbitrarily name the folder for the install. It's also useful with thumb drives and CD where the drive letters are unknown.

Quote
I am modifying a piece of software that is installed on a server. It works on the server as programmed but won't on my local PC with all the references path created. Is there some setting that need to be set before this command can be used?

Need more details. Would you post some code please? One thing you'll need is an open path to the server. 8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

Tictoc

  • Guest
Re: Window Dos Command?
« Reply #5 on: January 08, 2008, 02:56:50 PM »
Sidewinder,
You're right! When I set the path to '..\' the program works on my local PC. It goes up one directory and execute the program, just like on the server.

Thank you,