EzDevInfo.com

windows-7 interview questions

Top windows-7 frequently asked interview questions

How to set java_home on Windows 7?

I went to the Environment Variables in 'System' in the control panel and made two new variables, one for user variables and one for system variables. Both were named JAVA_HOME and both pointing to

C:\Sun\SDK\jdk\bin

But for some reason, I still get the below error when running a Java command...

BUILD FAILED
C:\Users\Derek\Desktop\eclipse\eclipse\glassfish\setup.xml:161: The following error  occurred while executing this line:
C:\Users\Derek\Desktop\eclipse\eclipse\glassfish\setup.xml:141: The following error occurred while executing this line:
C:\Users\Derek\Desktop\eclipse\eclipse\glassfish\setup.xml:137: Please set java.home to a JDK installation

Total time: 1 second
C:\Users\Derek\Desktop\eclipse\eclipse\glassfish>lib\ant\bin\ant -f setup.xml
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
Buildfile: setup.xml

How can I fix this problem?


Source: (StackOverflow)

Git/Bash is extremely slow in Windows 7 x64

I've been using Git on both Windows and Ubuntu during the development of a small project, frequently flipping back and forth between the two. The issue I'm having is that Git/Bash consistently become slow. When I say slow, I mean that running cd takes anywhere from 8-25 seconds, running git commands take from 5-20 seconds, and ls can take up to 30 seconds sometimes. Needless to say, this is not fun, not to mention unproductive. I know Git is slower on Windows, but this is ridiculous.

The one solution which has worked--temporarily--for me has been to disable my network connection (as suggested in this answer), start git, and then reconnect. Sometimes it continues to run quickly for days after doing that, but the performance always degrades eventually. I've trawled through the msysgit discussion group, SO, msysgit issue list, etc. on and off for weeks, but I haven't been able to turn up solutions which work.

So far, I've tried:

  • Adding git & project folders to virus scanner's exclusion list
  • Disabling my virus scanner completely (Kaspersky IS 2011)
  • Ensuring that Outlook is not running (Outlook 2007)
  • Shutting down all other applications
  • Running git as administrator
  • Disabling network connection, starting git, and keeping connection disabled
  • Disabling network connection, starting git, re-enabling connection (works only occasionally)
  • Running git gc
  • And combinations of the above

I did read that a couple people had success disabling bash completion, but ideally I'd like to keep that active. The version of msysgit is 1.7.3.1-preview20101002 & the OS is Windows 7 x64. Running the same things on Linux is, predictably, lightning fast. I would use Linux exclusively, but I need to run stuff in Windows, too (certain apps, testing, etc.).

Has anyone encountered a similar issue? If so, what was the underlying problem and what was the solution (if any)?

Edit: This extends beyond just the git repositories, but just for reference, the repos I've been using git with have been pretty small: ~4-50 files max.


Source: (StackOverflow)

Advertisements

The 'json' native gem requires installed build tools

I have ruby 1.9.2p180 (2011-02-18) [i386-mingw32] installed on my windows 7 machine. Now I tried to install the json gem using the command, "gem install json" and got the following error.

ERROR:  Error installing json:
    The 'json' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from '[http://rubyinstaller.org/downloads][1]' and follow the instructions
at '[http://github.com/oneclick/rubyinstaller/wiki/Development-Kit][2]'

Then I went and downloaded DevKit-4.5.0-20100819-1536-sfx.exe. Extracted it to C:\DevKit. And then from the command prompt I executed the following commands.

ruby dk.rb init

After the above command is executed, i verified that config.yaml is generated and it has the path for my ruby folder added automatically. This is the line at the bottom of the config.yaml file "- C:/Ruby192"

ruby dk.rb review

I got the message that devkit functionaliy will be injected into the rubies when you run "ruby dk.rb install"

ruby dk.rb install

I got the following message.

[INFO] RubyGems override already in place for C:/Ruby192, skipping.
[INFO] Installing C:/Ruby192/lib/ruby/site_ruby/devkit.rb

Now I tried executing the JSON gem again using the command gem install json. Then got the same error message as before.

ERROR:  Error installing json:
    The 'json' native gem requires installed build tools.........

Am I missing something.


Source: (StackOverflow)

"Active Directory Users and Computers" MMC snap-in for Windows 7?

Is there an equivalent tool available for use in Windows 7? I just need to browse the membership of some small Active Directory groups that are deep within a huge hierarchy, so I can eventually write code to work with those groups. The Windows Server 2003 version of the installer works, but the resulting MMC snap in just won't start up.

EDIT: I'd like to preemptively strike against more requests to close the question. This is a tool that I assume many programmers use to assist in programming-related tasks such as testing code that modifies Active Directory content. There are tons of other questions about developer tools here on Stack Overflow.


Source: (StackOverflow)

How do I run a python program in the Command Prompt in Windows 7?

I'm [relatively] new to Python. I'm trying to figure out how to run Python programs with the Command Prompt on Windows 7. (I should have figured this out by now...)

When I typed "python" into the command prompt, I got the following error:

'python' is not recognized as an internal or external command, operable program or batch file.

The first place I found when looking for help was this site: http://docs.python.org/faq/windows.html#how-do-i-run-a-python-program-under-windows.

It was somewhat helpful, but the tutorial was written for Windows 2000 and older, so it was minimally helpful for my Windows 7 machine. I attempted the following:

For older versions of Windows the easiest way to do this is to edit the C:\AUTOEXEC.BAT >file. You would want to add a line like the following to AUTOEXEC.BAT:

This file did not exist on my machine (unless I'm mistaken).

Next, I tried this: (here: How do I run a Python program?)

Putting Python In Your Path

Windows

In order to run programs, your operating system looks in various places, and tries to match the name of the program / command you typed with some programs along the way.

In windows:

control panel > system > advanced > |Environmental Variables| > system variables -> Path

this needs to include: C:\Python26; (or equivalent). If you put it at the front, it will be the first place looked. You can also add it at the end, which is possibly saner.

Then restart your prompt, and try typing 'python'. If it all worked, you should get a ">>>" prompt.

This was relevant enough for Windows 7, and I made my way to the System Variables. I added a variable "python" with the value "C:\Python27"

I continued to get the error, even after restarting my computer.

Anyone know how to fix this?


Source: (StackOverflow)

How to find out if an installed Eclipse is 32 or 64 bit version?

How can I find out if a specific Eclipse instance on my (Windows 7) PC is the 32-bit or 64-bit version?

I've checked the About screen and the maze of dialogs one can call from there, but I didn't find any clues.

Also, right-clicking eclipse.exe in Windows explorer and opening the properties dialog box didn't give any hints.


Source: (StackOverflow)

How to run a program automatically as admin on Windows startup?

I created my own parental control app to monitor my kids activity. The app's only GUI is a task bar icon. The program is installed as admin. I'd like this program to be started up automatically as admin user on Windows startup, so that standard users cannot kill it from task manager.

I can create a registry key at:

HKLM\Software\Microsoft\Windows\CurrentVersion\Run

to make it run automatically when Windows starts up. The problem is that the program is started as the logged in (standard) user.

How can I make it run in an elevated mode? Is this possible at all in Win7?


Source: (StackOverflow)

How to force my .NET App to run as administrator on Windows 7?

Once my program is installed on a client machine, how do I force my program to run as an administrator on Windows 7?


Source: (StackOverflow)

Sublime Text from Command Line (Win7)

I installed Sublime Text and wanted to know how to open rb files in it from terminal. I saw this thread and I see that I can make Sublime my core editor, but I want to be able to type

sublime file.rb

How do I do this in Win7?


Source: (StackOverflow)

port forwarding in windows

I have two network board in my pc:

The main one has the local ip -> 192.168.1.111 The secondary ones has the local ip -> 192.168.0.200

The main one has internet connection and the second one is connected to a device with the IP 192.168.0.33, it has a http server in port 80.

I have an apache-server in the main connection (port 4422), and I can access from anywhere, what I want now is when I detect a connection from 4422 i want to redirect this connection to 192.168.2.33:80

How can I do this with windows?


Source: (StackOverflow)

WCF ServiceHost access rights

I get the following error when going through the WCF tutorial.

HTTP could not register URL http://+:8000/ServiceModelSamples/Service/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).

Is this something caused by a restriction on Windows 7?


Source: (StackOverflow)

How do I register a DLL file on Windows 7 64-bit?

I have tried to use the following code:

cd c:\windows\system32
regsvr32.exe dllname.ax

But this is not working for me. How can I register a DLL file on Windows 7 with a 64-bit processor?


Source: (StackOverflow)

Is it possible to install both 32bit and 64bit Java on Windows 7?

Is it possible to install both 32bit and 64bit Java on Windows 7?

I have some applications that I can run under 64bit, but there are some that only run under 32bit.


Source: (StackOverflow)

Has Windows 7 Fixed the 255 Character File Path Limit?

As I understand it, the limitation of 255 characters in a file path is a Windows limitation. What is the reasoning for this? If so, has this been resolved in Windows 7?

In our continuous integration practices, we often have deeply nested project structures and it would be extremely useful to be able to go beyond 255 characters. Right now we are somewhat forced to structure our projects in such a way as to not hit this artificial ceiling.


Source: (StackOverflow)

HttpListener Access Denied

I am writing an HTTP server in C#.

When I try to execute the function HttpListener.Start() I get an HttpListenerException saying

"Access Denied".

When I run the app in admin mode in windows 7 it works fine.

Can I make it run without admin mode? if yes how? If not how can I make the app change to admin mode after start running?

using System;
using System.Net;

namespace ConsoleApplication1
{
    class Program
    {
        private HttpListener httpListener = null;

        static void Main(string[] args)
        {
            Program p = new Program();
            p.Server();
        }

        public void Server()
        {
            this.httpListener = new HttpListener();

            if (httpListener.IsListening)
                throw new InvalidOperationException("Server is currently running.");

            httpListener.Prefixes.Clear();
            httpListener.Prefixes.Add("http://*:4444/");

            try
            {
                httpListener.Start(); //Throws Exception
            }
            catch (HttpListenerException ex)
            {
                if (ex.Message.Contains("Access is denied"))
                {
                    return;
                }
                else
                {
                    throw;
                }
            }
        }
    }
}

Source: (StackOverflow)