• Post Reply Bookmark Topic Watch Topic
  • New Topic

DOS shortcuts: sick of typing c:\2ee\blah\blah  RSS feed

 
tim mahoney
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Guys,

How and where can I define global vars to use in DOS. Would like to have something setup to go to my dev directory, j2ee, stuff like that. For example, instead of c:\blah\blah. Would like to just type in cd $gowork

Thanks,
 
Giovanni De Stefano
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
your question is not that clear...

If you want to do something like cd %GOTOWORK% instead of cd c:/bla/bla/bla/foo/bla/foo, you have to SET the environmental variable called GOTOWORK, put its value to c:/bla/bla/bla/foo/bla/foo and then you can type cd %GOTOWORK%.

If you are asking this question to make going to the bin directory of java easier...try cd %JAVA_HOME%, if JAVA_HOME is not set...well you should make it point to the home dir of your Java SDK.

It's very tedious develping software using the command line, try use an IDE like Eclipse, but if you are REALLY new to Java, than keep using the command line until you uderstand they way the write code/compile/execute process works.

P.S. you also asked how and where you can find those variables...if you want to check if a variable is set, say you want to check if the variable JAVA_HOME is set, then type echo %JAVA_HOME% and press enter. In Windows XP you can check, set, add, remove and modify your environment variables following the path: start-->control panel-->Performance and Maintainance-->System-->Advanced-->Environment variables

Giovanni
[ April 29, 2005: Message edited by: Giovanni De Stefano ]
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, (If you're not on XP), try turning on tab-completion in the DOS prompt. (XP comes with this set by default..)

Open up the Registry (regedit) and navigate to HK_CURRENT_USER/Software/Microsoft/Command Processor/ and look for the key Completion Character. Change this value to a "9" (for tab). Open up a new Command Prompt (existing ones don't get the change) and try it out! type "cd c:\pr<tab>" and see it change to "C:\Program Files".
[ April 29, 2005: Message edited by: Joel McNary ]
 
tim mahoney
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Thats what I needed.
 
Abhinav Srivastava
Ranch Hand
Posts: 354
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
C:> SUBST /?
Associates a path with a drive letter.

SUBST [drive1: [drive2:]path]
SUBST drive1: /D

drive1: Specifies a virtual drive to which you want to assign a path.
[drive2:]path Specifies a physical drive and path you want to assign to
a virtual drive.
/D Deletes a substituted (virtual) drive.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!