From: Rajinder Yadav Date: 2010-11-07T07:43:44+09:00 Subject: Re: Maybe not a Ruby question but I still need to know On 10-11-06 02:19 AM, Kaye Ng wrote: > I'm using windows XP. I save my practice files in my thumb drive - > H:\Ruby\Practice , this directory is added to the path variables (in > Environment Variables), so that when I open command prompt and the > default directory is C:\Documents and Settings\user> , I can run my > problem example1.rb (which is in H:\Ruby\Practice) by typing "example1" > like so: > > C:\Documents and Settings\user>example1 > > and it would run just fine, even if example1.rb is not in the default or > current directory (C:\Documents and Settings\user>). > > However, I have another file saved in the same folder as example1.rb (in > the thumb drive), and the code opens a text file (about 18 paragraphs > worth of text). Why is it that I cannot run it directly from > C:\Documents and Settings\user like I did with example1.rb? I have to > go to H:\Ruby\Practice and type in the text file's filename. > > Thanks guys! > what are you saying? that you want"H:\Ruby\Practice\example1.rb" to run when you are in "C:\Documents and Settings\user" ?? if that's what you're asking it can't be done just using the filname! Either you CD into the folder, or provide the full pathname + filename, "H:\Ruby\Practice\example1.rb" -- Kind Regards, Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely GNU/Linux: 2.6.35-22-generic Kubuntu x86_64 10.10 | KDE 4.5.1 Ruby 1.9.2p0 | Rails 3.0.1