Whats going on!?!?

E

Erik Boling

Ok so I was programming perfectly fine earlier yesterday, then i got
this idea about instead of going through cmd to open my program, why not
just chose cmd as the program to open it?... bad idea i got this weird
access denied error. Then it would do that to every program i tried to
run, even new ones i made. Then i accidentally set scite as the default
to open the files, so when i ran them in cmd it would just open scite
and show me the code. so i re-installed ruby, and the access denied erro
still pops up when i try and run any ruby program? Any one know what i
need to do to fix this?

Many thanks,
Erik
 
P

Phlip

Erik said:
it would just open scite
and show me the code. so i re-installed ruby, and the access denied erro
still pops up when i try and run any ruby program? Any one know what i
need to do to fix this?

Get CygWin (but not its Ruby), and learn to use BASH, a real command
line interface. After a little easy tuning it's easier than mouse
abuse.

Then get with a Windows tutorial (under the wild assumption you use
Windows), and then learn to de-gunk your system registry. It has a
link to the wrong ruby, possibly rubyw.exe. Uninstalling Ruby won't
remove the link because it's outside Ruby's home folder in the
registry. Back your 'puter up before twiddling with the registry!

Then erase your Windows and get Linux. It supports symlinks, which
make most of that ridiculous registry unneeded.
 
G

Gordon Thiesfeld

Ok so I was programming perfectly fine earlier yesterday, then i got
this idea about instead of going through cmd to open my program, why not
just chose cmd as the program to open it?... bad idea i got this weird
access denied error. Then it would do that to every program i tried to
run, even new ones i made. Then i accidentally set scite as the default
to open the files, so when i ran them in cmd it would just open scite
and show me the code. so i re-installed ruby, and the access denied erro
still pops up when i try and run any ruby program? Any one know what i
need to do to fix this?

While it may be possible to set Windows up to do this, I think it
would cause other problems; for instance, opening a new cmd prompt
each time you type it on the command line. I changed the open action
on .rb files to run cmd.exe, and then I changed it back like this:

C:\>assoc .rb
rb=rbFile

C:\>ftype rbFile
rbFile=cmd.exe "%1" %*

C:\>ftype rbFile="C:\ruby\ruby186\bin\ruby.exe" "%1" %*
rbFile="C:\ruby\ruby186\bin\ruby.exe" "%1" %*

The path to your ruby executable is probably different than mine. Let
me know if that works.

Regards,

Gordon
 
P

Phlip

Just quietly, I don't think it's symlinks which mean we don't need a
registry ...

No, we just need a rambling /etc folder full of spaghetti
configurations, each one written in its own Custom Configuration
Language /Du-Jour/!
To the OP: look up on "file associations" in Windows. Gordon's reply is
good.

Jah - I only knew how to hack the registry. (-;
 
E

Erik Boling

C:\>assoc .rb
rb=rbFile

C:\>ftype rbFile
rbFile=cmd.exe "%1" %*

C:\>ftype rbFile="C:\ruby\ruby186\bin\ruby.exe" "%1" %*
rbFile="C:\ruby\ruby186\bin\ruby.exe" "%1" %*

Ok i have really no clue on what you are saying there, are all those
just file locations, do i need to make the?, do i have to create a file
association * which i'm not sure how to do*? thank you for all the
replies but i'm a bit confused right now :\.
 
P

Phlip

Erik said:
C:\>assoc .rb
.rb=rbFile

C:\>ftype rbFile
rbFile=cmd.exe "%1" %*

C:\>ftype rbFile="C:\ruby\ruby186\bin\ruby.exe" "%1" %*
rbFile="C:\ruby\ruby186\bin\ruby.exe" "%1" %*

Ok i have really no clue on what you are saying there, are all those
just file locations, do i need to make the?, do i have to create a file
association * which i'm not sure how to do*? thank you for all the
replies but i'm a bit confused right now :\.

Click on Start, click on Run, type CMD, press Enter, and enter these
commands:

assoc /?
ftype /?
 
E

Erik Boling

Click on Start, click on Run, type CMD, press Enter, and enter these
commands:

assoc /?
ftype /?
Ok here you go, this is what i get, maybe you guys know what i need to
do.. oh yea dont get fooled by my default location, i changed it to that
file a while ago and things have been working fine.


Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\TestProgramsT>assoc /?
Displays or modifies file extension associations

ASSOC [.ext[=[fileType]]]

.ext Specifies the file extension to associate the file type with
fileType Specifies the file type to associate with the file extension

Type ASSOC without parameters to display the current file associations.
If ASSOC is invoked with just a file extension, it displays the current
file association for that file extension. Specify nothing for the file
type and the command will delete the association for the file extension.

C:\TestProgramsT>ftype /?
Displays or modifies file types used in file extension associations

FTYPE [fileType[=[openCommandString]]]

fileType Specifies the file type to examine or change
openCommandString Specifies the open command to use when launching
files
of this type.

Type FTYPE without parameters to display the current file types that
have open command strings defined. FTYPE is invoked with just a file
type, it displays the current open command string for that file type.
Specify nothing for the open command string and the FTYPE command will
delete the open command string for the file type. Within an open
command string %0 or %1 are substituted with the file name being
launched through the assocation. %* gets all the parameters and %2
gets the 1st parameter, %3 the second, etc. %~n gets all the remaining
parameters starting with the nth parameter, where n may be between 2 and
9,
inclusive. For example:

ASSOC .pl=PerlScript
FTYPE PerlScript=perl.exe %1 %*

would allow you to invoke a Perl script as follows:
Press any key to continue . . .
 
E

Erik Boling

Sorry, ok so i figured out what gordon was talking about so i i changed
the ftype and assoc just as he did, then restarted cmd, and I'm still
getting the " is not a valid win32 app" error?
 
E

Erik Boling

Michael said:
Indeed! It's a bunch of config files of different formats scattered
across
the file system. Scary thing is, that actually does seem to work better
than the window registry.

ok soooo, what can i do to fix it!?!?!
 
G

Gordon Thiesfeld

ok soooo, what can i do to fix it!?!?!

Here are some things to check:

# Make sure the path to ruby.exe is in your path system environment
variable
C:\>path
PATH=c:\ruby\ruby186\bin;C:\WINDOWS;C:\WINDOWS\System32\Wbem

# Make sure .rb and .rbw are set in the pathext system environment
variable
C:\>echo %pathext%
COM;.EXE;.BAT;.CMD;.RB;.RBW;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.tcl;.PSC1

# If it's a problem with these system environment variables, make sure you
set it in the gui, and not with the set command. Otherwise the
changes won't persist. Here's some info on that:
http://support.microsoft.com/kb/310519

What is the output of these commands?

ruby -v

ruby -e 'puts "hello world!"

regards,

Gordon
 
E

Erik Boling

# Make sure the path to ruby.exe is in your path system environment
variable
C:\>path
PATH=c:\ruby\ruby186\bin;C:\WINDOWS;C:\WINDOWS\System32\Wbem

# Make sure .rb and .rbw are set in the pathext system environment
variable
C:\>echo %pathext%
.COM;.EXE;.BAT;.CMD;.RB;.RBW;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.tcl;.PSC1
OK i did both of these checks, both are seem to be fine.

C:\>path
PATH=c:\ruby\bin;C:\GTK\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\W
bem;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program
Files\Quick
Time\QTSystem\;C:\Program Files\ATI Technologies\ATI.ACE\

C:\>echo %pathext%
COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.RB;.RBW

C:\>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top