The MASM Forum

Miscellaneous => The Orphanage => Topic started by: KeepingRealBusy on July 31, 2012, 09:47:07 AM

Title: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: KeepingRealBusy on July 31, 2012, 09:47:07 AM
I'm having a wee bit of a problem on my new system.

I installed Visual Studio 2008 on my new laptop (my old system died). I had already tried to use
ML and LINK and mspdb80.dll which were in my TOOLS directory, but the system said that "mspdb80 is
the wrong version, check installation", so I tried the install. I had already used bcdedit.exe to
modify the path to add my TOOLS directory (there is no more autoexec.bat in Windows 7 - and I was
coming from Windows XP).

Now when I execute bcdedit.exe (as administrator) I now just get a flash on the screen (starts to
execute then immediately quits). I wrote a pathedit.bat file to execute bcdedit.exe (from its
location in the Windows 7), then pause. I get the following when I execute it:

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

     \mail\autoexec>pathedit
                              (which contains:

                                  C:\Windows\System32\bcdedit.exe
                                  pause

     \mail\autoexec>C:\Windows\System32\bcdedit.exe
    'C:\Windows\System32\bcdedit.exe' is not recognized as an internal or external command,
    operable program or batch file.

     \mail\autoexec>pause
    Press any key to continue . . .

Why does Windows now say that bcdedit.exe "is not recoginized..."

Has the installation of Visual Studio 2008 clobbered Windows 7?  It did not report any errors,
but I have not tested Visual Studio yet.

Note the following PATH display.
The first entry is where I added the path to my TOOLS directory before I installed Visual Studio.
The last entry (at least the last entry - I don't have a copy of the path from before the Visual
Studio install) is where Visual Studio added the entry for "Microsoft SQL Server\90\Tools\binn\ and
I had noticed that installation as it installed.

PATH=F:\DATA(F)\xxxxxxxxxx\yy\TOOLS;C:\Program Files (x86)\HP SimplePass 2012\x64;C:\Program Files (
x86)\HP SimplePass 2012\;;C:\Program Files\Broadcom\Broadcom 802.11\Driver;;C:\Program Files (x86)\A
MD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files\Common Files\Microsoft Sha
red\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system
32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files
(x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShare
d\;C:\Program Files (x86)\Common Files\Roxio Shared\12.0\DLLShared\;C:\Program Files (x86)\Windows L
ive\Shared;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\WIDCOMM\Blue
tooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Broadcom\WHL\;
C:\Program Files\Broadcom\WHL\syswow64;C:\Program Files\Broadcom\WHL\SysWow64\;C:\Program Files\Broa
dcom\WHL\SysWow64\syswow64;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\

What should I do other than restore the system from before the installation attempt?
I did take a full system Norton Ghost save to my backup external drives before the install
(actually, a Symantic Recovery Disk full save with the system shut down).

Has anyone else run into this?
Has anyone got any ideas?

Dave.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: Ryan on July 31, 2012, 10:04:29 AM
I have Windows 7.  If memory serves I installed C# 2008 Express before upgrading to 2010.  My bcdedit.exe still exists in my system32 folder.  Could you download it from somewhere or get it off the Windows 7 DVD?  I've noticed that Dell in particular has stopped sending recovery discs with new computers.  They charge for them now.  I could probably zip my file and attach it to a post.  I'm not exactly sure if that's legal though.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: KeepingRealBusy on July 31, 2012, 10:16:26 AM
Ryan,

I do not need a copy of bcdedit.exe. See the CodeProject.com forum to see the steps I have already tried: http://www.codeproject.com/Messages/4323772/Windows-7-visual-studio-2008-problem.aspx.

Dave.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: Ryan on July 31, 2012, 10:24:59 AM
Have you tried running bcdedit through Windows Explorer?  It should do nothing, but I'm more curious if you get any errors through Windows Explorer.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: Ryan on July 31, 2012, 10:30:00 AM
Actually, your prompt style is unfamiliar to me.  Are you able to get to the system32 directory?
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: KeepingRealBusy on July 31, 2012, 10:38:28 AM
Ryan,

Thank you for the responses.

Yes, I can get to the directory via explorer. If I try to execute bcdedit.exe from explorer, it just flashes the screen. That is why I built a .bat to execute followed by a pause, and found the reason that bcdedit.exe would not execute.

As far as the prompt, I did not want to display my system username.

Dave.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: Ryan on July 31, 2012, 10:47:47 AM
Have you tried running an elevated command prompt directly?  There are two ways I know how to do this.  You can go through Programs->Accessories->Command Prompt->right-click and click Run as administrator.  Windows will most likely prompt you about the command prompt making changes, so on and so forth.  Once the command prompt is up, you should be in the system32 directory.  If it is any other directory, the elevated command prompt didn't take hold.

The second way is to click on the Start menu, and type in cmd in the search box.  cmd.exe should be listed in the programs.  From there, it's Ctrl+Shift+Enter.  Like before, Windows will probably prompt you about making changes, etc.

The system32 directory is key to determining if you have an elevated prompt.  You should simply be able to type bcdedit.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: KeepingRealBusy on July 31, 2012, 10:52:34 AM
Ryan,

I will try these methods.

Strange that, when I ran bcdedit.exe the first time before the install, I selected bcdedit.exe from explorer, then right click and run as administrator and it worked.
Now, it just flashes.

Gone to have dinner, be back shortly.

Dave.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: Ryan on July 31, 2012, 10:59:53 AM
How did it work?  If you run bcdedit without switches, it simply gives you the list of current settings.  Did you tell it to leave the window open after execution was complete?  Otherwise, it would just flash.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: KeepingRealBusy on July 31, 2012, 12:18:19 PM
Ryan,

How do you run bcdedit with switches? I can execute bcdedit.exe with right click and run as administrator, and it just flashes. I can execute using shift ctl enter and it just flashes.

If I bring up a dos prompt from a 32 bit editor, I can go to c:\windows\system32\bcdedit.exe, but again just get a screen flash.

The only thing that seems to (partially) work is to use all programs>accessories>command prompt, and right click and run as administrator. This gives me a command prompt, but shows me that I  am at my user level, however just typing "bcdedit" does execute something as if I were at c:\windows\system32\:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\xxxx>bcdedit

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
extendedinput           Yes
default                 {current}
resumeobject            {158181c0-9a00-11db-8a1d-b11d19fd3102}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30
customactions           0x1000085000001
                        0x5400000f
custom:5400000f         {b61827e7-a53e-11e1-983c-e3ea458117bf}

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {b61827e7-a53e-11e1-983c-e3ea458117bf}
recoveryenabled         Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {158181c0-9a00-11db-8a1d-b11d19fd3102}
nx                      OptIn

C:\Users\xxxx>

If I say "path" then it gives me my path environment variable. But, no way to edit it. Quite frankly, I have forgotten EXACTLY what I did to initially edit the path, but it did happen.

May I quote my dear old dad here "gimmie my horse". What was wrong with the XP autoexec.bat as an editable file that had the drawback that you had to boot to get the changes to take effect?

Dave.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: Ryan on July 31, 2012, 09:29:03 PM
I'm not exactly sure what you want to do with bcdedit, but here are a couple of links to read.

http://technet.microsoft.com/en-us/library/cc709667%28v=ws.10%29.aspx
http://www.sevenforums.com/tutorials/2676-bcdedit-how-use.html
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: KeepingRealBusy on August 04, 2012, 01:20:43 PM
Ryan,

Finally found out how to do this. Start > Control Panel > System > Advanced settings > Environment Variables.

Dave.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: dedndave on August 04, 2012, 09:18:32 PM
i can't count how many times i have posted that
i even used to put pictures with it - lol
the one trick that they don't tell you....
copy the longer environment variable strings to a temporary text file to edit them - then paste back
much easier to get the PATH right than with that little box MS gives you
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: KeepingRealBusy on August 05, 2012, 02:05:48 AM
dednddave,

You may have posted that, but I ignored it since I was on XP. Now that I am on Windows 7, I have this steep learning curve - "How do I do this?" Windows Help is nearly useless. Slowly I am becoming more familiar, but that doesn't mean that I like it a bit. If I could get XP64 with drivers to match from HP, I would change in a flash.

I agree about editing the path. Do a Path in a cmd window, edit it and then copy the result, then go to edit the actual Path (replace whatever was there with your new version).

Dave.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: KeepingRealBusy on August 05, 2012, 02:13:51 AM
Quote from: dedndave on August 04, 2012, 09:18:32 PM
much easier to get the PATH right than with that little box MS gives you

Talk about small boxes, I tried to install Windows XP SP3. It didn't work. I then had to try to recover from a recovery point. The recovery "worked", but at the end it said that it had to rename a few files. They posted these full path strings in a small box (10 or 20 characters by 10 lines) with both a horizontal and vertical scroll bar, and the list included (I think) all of the system32 dlls. I didn't trust the recovery, so I just blew it away with a diskimage restore from a backup I did just before the attempted install.

Dave.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: dedndave on August 05, 2012, 03:15:54 AM
yah - now that i have my backup images, i have disabled system restore on all disks
system restore can make a mess out of things when it does work
and - many viruses disable it - some even delete all the restore points
so - what good is it

as for the edit - i wasn't talking about a command window
i was talking about pasting the line into NotePad
then edit it and paste it back into the little box   :t
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: jj2007 on August 05, 2012, 07:23:37 AM
And don't forget wbem: %SystemRoot%\System32\Wbem
It's a Windows core component since ME or so, but the poor thing still has not learnt where is home sweet home... now imagine all other 1,000 or so Windows core components needed an entry into The Path - what is the limit for a string in the registry?  ;)
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: KeepingRealBusy on August 06, 2012, 09:29:47 AM
Quote from: dedndave on August 05, 2012, 03:15:54 AM
as for the edit - i wasn't talking about a command window
i was talking about pasting the line into NotePad
then edit it and paste it back into the little box   :t

Dave,

I tried both ways and it seems easier the way I am doing it.

To copy the path you need Start>ControlPanel>System>Advanced>EnvironmentVariables>SelectPath>Edit>RightClick>Copy. Then you have to find Notepad. In my case I use a desktop ICON to start PFE. Unfortunately, there are three Windows up, and the last two seem to be child windows of the prior Window and no amount of coaxing will move the prior Windows to uncover the PFE icon. I could use Start and find PFE.but think the following is easier (In PFE the CMD window is free standing and the PFE Window can be closed , minimized, moved, etc):

DesktopPFEIcon>Doubleclick>Execute>Dosprompt>"Path" (you now have the full path in a .txt window).
CmdHeader>RightClick>Edit>SelectAll">CmdHeader>RightClick>Edit>Copy>close Cmndprompt
PFE>File>New>Paste>edit path (you now have the edited path in a .txt file window)>SelectAll>Copy
Now access the old path with  Start>ControlPanel>System>Advanced>EnvironmentVariables>SelectPath>Edit>Paste into the variable data>OK>close>close>close.

Dave

Dave.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: dedndave on August 06, 2012, 10:47:08 AM
find an open space (i.e., not on a file or shortcut) in explorer or on the desktop
right-click - New - Text Document
opens Notepad for you
when you are done, close it and opt not to save   :P
right-click on the "New Document.txt" - Delete
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: KeepingRealBusy on August 06, 2012, 12:30:21 PM
Dedndave,

I don,t know what you've been smokin', but a right click on an empty space on the desktop gives me a choice of new, but only... wait a minute! I get no new text file option, but a start for PFE (which has grabbed .txt extension)! The same thing happens on Explorer. Thank you for the new method of getting to PFE. Apparently, it gives you the start of whatever is the program to edit the .txt file extension (there are other choices of programs to process other file types).


Thank you.

Dave.
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: dedndave on August 06, 2012, 01:10:12 PM
not sure what PFE is - lol
but - i would not like it to take over .txt associations, unless i requested it

you can add new things to the list by creating a template file
they go in C:\Documents and Settings\<UserName>\Templates
then - associate the file type and add a registry entry
in the old forum, i did a reg file for creating an ASM template   :P
i right-click, new, asm file - and bang, it has the include, data/code sections, and _main
Title: Re: Windows 7 and Visual Studio 2008 installation kills Windows 7 bcdedit.exe
Post by: KeepingRealBusy on August 06, 2012, 01:27:37 PM
PFE is Programmers File Editor (last version was in 99) I got used to working with it at work, never saw a real need for a context sensitive editor with different colors. I want it to grab .txt files.

Dave.