Page 1 of 1

Windows ahows all .bas files as "type Freebasic".

Posted: Sat Nov 01, 2008 3:50 pm
by Ralph
Why do my .bas files, when viewed in the Windows Explorer, say they are of type Frebasic? I once had FB, but have uninstalled it from the Control Panel "Add and Remove Programs", then deleed my FB folder" It still, somehow, remembers FB as the type. As to the .bas extension, I have set it up under the Folder Options so that double clicking on any .bas files opens QB.exe, than QB opens the file, so that's O.K. It just that it irks me to see what I consider QuickBASIC files being shown as being FreeBASIC files. Any idea hos to change that pesky type to show as QuickBASIC?

Posted: Sat Nov 01, 2008 4:03 pm
by TmEE
Only method I know is editing the Registry...

Posted: Sat Nov 01, 2008 4:32 pm
by Mentat
That's because the computer looks up the extension's association (.bas is bas_auto_file, I think), then looks up the file type for the association (in this case, bas_auto_file loads up whatever directory it was last told. As far as I know, add/remove programs does not un-associate extensions with the program you use to open it.

Posted: Sat Nov 01, 2008 10:36 pm
by Anonymous
Try going into my computer -> Tools -> Folder Options -> File Types -> and then go down to BAS and go into Advanced and change the icon.

Posted: Sun Nov 02, 2008 7:14 am
by Mentat
I have a handy program that does that for associating my file extensions on the first time, instead of having to look it up. This code is for running fbIde off my jump drive, so it has to do a little searching first. The same idea applies to QB, but you probably don't need all the drive stuff and you have to set the directory to QB, instead of FB.

Code: Select all

#define quotes chr(34)
declare function driveExists(as string) as integer
declare sub assoc(as string, as string)
declare sub fType(as string, as string)

dim drive as string

'associating freebasic files
assoc("bas", "bas_auto_file")
assoc("bi", "bi_auto_file")
assoc("dev", "dev_auto_file")
assoc("cpp", "dev_auto_file")
assoc("h", "dev_auto_file")


if driveExists("E") then
    print "Resident in E drive"
    drive = "E"
elseif driveExists("F") then
    print "Resident in F drive"
    drive = "F"
elseif driveExists("G") then
    print "Resident in G drive"
    drive = "G"
elseif driveExists("H") then
    print "Resident in H drive"
    drive = "H"
end if

fType("bas_auto_file", drive + ":\fbasic\freebasic\fbide.exe " + quotes + "%1" + quotes)
fType("bi_auto_file", drive + ":\fbasic\freebasic\fbide.exe " + quotes + "%1" + quotes)
fType("dev_auto_file", drive + ":\Dev-Cpp\devcpp.exe " + quotes + "%1" + quotes)
fType("cpp_auto_file", drive + ":\Dev-Cpp\devcpp.exe " + quotes + "%1" + quotes)
fType("h_auto_file", drive + ":\Dev-Cpp\devcpp.exe " + quotes + "%1" + quotes)

sleep
end

sub assoc(extension as string, fileType as string)
    dim pass as string = "assoc ." + extension + "=" + fileType
    shell(pass)
end sub

sub fType(fileType as string, program as string)
    dim pass as string = "fType " + fileType + "=" + program
    shell(pass)
end sub

function driveExists(drive as string) as integer
    dim file as string
    dim fileNum as integer = freeFile
    file = drive + ":\start up.bas"
    open file for input as #fileNum
    if err = 2 then
        close #fileNum
        return 0
    else
        close #fileNum
        return &hFFFFFFFF
    end if
end function 

Posted: Mon Nov 03, 2008 12:05 am
by Nodtveidt
You could just open up regedit and delete HKEY_CLASSES_ROOT\.bas

Posted: Mon Nov 03, 2008 12:26 pm
by burger2227
On my PC, .BAS files are associated with Visual Basic. Thus, if you click on them, VB displays them. So I often have to Open with QB or use the QB IDE.

You can add QB to the Open with Menu also. Windows may not list it, so just find QB.EXE or QBASIC.EXE on the drive search.

I do NOT recommend messing with the Registry! There is no need to.

Ted

Posted: Mon Nov 03, 2008 11:17 pm
by Ralph
TmEE: Can you give me a detailed, step-by-step on how to edit the register to get the result I would like? Thank you.

Mentat: I changed the association already, besides deleting all the fb files. All works correctly, except the type for .bas shows as a fb file. I just want to get rid of that false information.

Nixon: I have changed the association. There was one iconwith the .bas associated with FreeBASIC. I have now deleted that association. Perhaps, if I close Windows and restart, all will be well. I'll check it later.

Nodtveidt: How do I get to regedit, and then to HKEY_CLASSES_ROOT\.bas. Then, how do I replace that with the proper code so that the type will say, "QuickBASIC source code:?

Ted: I already have .bas associated with QuickBASIC. That is not my problem. I just want the type to show as "QuickBASIC source file", and not "FreeBASIC source file".

Posted: Tue Nov 04, 2008 1:17 am
by burger2227
Ralph, there is no Windows icon for BAS files! Just pick a pretty one.

Do what Nixon said:
Try going into my computer -> Tools -> Folder Options -> File Types -> and then go down to BAS and go into Advanced and change the icon.
Don't mess with the Registry at your age, :lol:

Ted

Posted: Tue Nov 04, 2008 4:36 pm
by Ralph
Burger22: You wrote:
Try going into my computer -> Tools -> Folder Options -> File Types -> and then go down to BAS and go into Advanced and change the icon.
That/sfine. I went to Tools, folder Options, File ypes, and then, down to BAS. It says, under File Types, "BAS file" I would like to see, "QuickBASIC file". If I double click on BAS, I read, "BAS Opens with QB", and it does. Oh, and I don't see any "Advanced" anyplace here.

I go to Windows Explorer, click on C:, QB, look at the .bas files, and, under Type, it reads, "FreeBASIC source file". I want it to read, "QuickBASIC file".

How can I get my wish?

You also wrote,
Don't mess with the Registry at your age
That was funny - and wise!

Posted: Tue Nov 04, 2008 7:42 pm
by Nodtveidt
Ralph wrote:Nodtveidt: How do I get to regedit, and then to HKEY_CLASSES_ROOT\.bas. Then, how do I replace that with the proper code so that the type will say, "QuickBASIC source code:?
Okay, go to the Run option in your start menu, and type "regedit". It will bring you to the registry editor. On the left is a treeview menu containing "My Computer" at the top, and then a collection of folders, labelled "HKEY_CLASSES_ROOT", "HKEY_CURRENT_USER", "HKEY_LOCAL_MACHINE", "HKEY_USERS", and "HKEY_CURRENT_CONFIG". This is normal for XP. Anyways, click on the + sign next to HKEY_CLASSES_ROOT (or double-click on the folder), and a large list will appear. Scroll down until you find one labeled ".bas". Click on it once, then hit your delete key. A confirmation prompt will pop up, confirming the deletion. Click "Yes". Now, reboot the system. When it comes back up, your .bas files should be unassociated. Right-click on one and click "Open With..." for a new dialog. Here, you are allowed to set the name yourself and choose the program to open it with.

Another option is to search the registry for the text in question. Press Ctrl+F, or go to the Edit menu and click Find. Under "Find what", enter the text you're looking for, and then uncheck the "Keys" box (since you're looking for data). I'd leave Values checked just in case there's additional keys that need to be changed. Now, when you find the entries, change them to whatever you want to change them to, but make sure you change them all. After you finish this, reboot the system, and everything will be just peachy.

Hope that helps ya out. :D You do need to be careful with regedit, as it is a very powerful tool that can completely hose your system if you mess up, but you shouldn't have any problems with such a simple operation as this.

Posted: Thu Nov 06, 2008 11:04 pm
by Ralph
Nodtveidt: Thank you for your patience and detailed informaitonl I was able o follow it well.

I now see all files with extension .bas, shwon as type "BAS file". I double clicked on one, and, the QuickBASIC IDE opened up, loaded that .bas file, and showed it. I checked on Tools, Folder Options, File Tupes, and saw that BAS files are associated with QB, as previously. I ran regedit, and found that the line with bas files that I deleted, is not there. So, in summary, I got red of the bas files appearing as type "FreeBASIC source file", and now get "bas file"

Is there anyway to get the file type to show as "QuickBASIC source file"?

Posted: Fri Nov 07, 2008 7:02 am
by Nodtveidt
Not sure what else you could try, except searching the registry for the Value of "BAS File" and changing it to whatever you need to change it to.