EzDevInfo.com

windows interview questions

Top windows frequently asked interview questions

Text editor to open big (giant, huge, large) text files [closed]

I mean 100+ MB big; such text files can push the envelope of editors.

I need to look through a large XML file, but cannot if the editor is buggy.

Any suggestions?


Source: (StackOverflow)

Node.js/Windows error: ENOENT, stat 'C:\Users\RT\AppData\Roaming\npm'

I have Windows 7 32-bit. I installed the latest Node.js 32 bit. When I try to run the command npm install jquery, I receive the error:

Error: ENOENT, stat 'C:\Users\RT\AppData\Roaming\npm

How does one resolve it?


Source: (StackOverflow)

Advertisements

How can I develop for iPhone using a Windows development machine?

Is there any way to tinker with the iPhone SDK on a Windows machine? Are there plans for an iPhone SDK version for Windows?

The only other way I can think of doing this is to run a Mac VM image on a VMWare server running on Windows, although I'm not too sure how legal this is.


Source: (StackOverflow)

What are good grep tools for Windows? [closed]

Any recommendations on grep tools for Windows? Ideally ones that could leverage 64-bit OS.

I'm aware of Cygwin, of course, and have also found PowerGREP, but I'm wondering if there are any hidden gems out there?


Source: (StackOverflow)

How do I get the application exit code from a Windows command line?

I am running a program and want to see what its return code is (since it returns different codes based on different errors).

I know in Bash I can do this by running

echo $?

What do I do when using cmd.exe on Windows?


Source: (StackOverflow)

How can you find and replace text in a file using the Windows command-line environment?

I am writing a batch file script using Windows command-line environment and want to change each occurrence of some text in a file (ex. "FOO") with another (ex. "BAR"). What is the simplest way to do that? Any built in functions?


Source: (StackOverflow)

How to pass command line parameters to a batch file?

I need to pass id and password to a cmd (or bat) file at the time of running rather than hardcoding them into the file.

Here's what the command line looks like:

test.cmd admin P@55w0rd > test-log.txt

Source: (StackOverflow)

Windows batch files: .bat vs .cmd?

As I understand it, .bat is the old 16-bit naming convention, and .cmd is for 32-bit Windows, i.e., starting with NT. But I continue to see .bat files everywhere, and they seem to work exactly the same using either suffix. Assuming that my code will never need to run on anything older than NT, does it really matter which way I name my batch files, or is there some gotcha awaiting me by using the wrong suffix?


Source: (StackOverflow)

How can I update the current line in a C# Windows Console App?

When building a Windows Console App in C#, is it possible to write to the console without having to extend a current line or go to a new line? For example, if I want to show a percentage representing how close a process is to completion, I'd just like to update the value on the same line as the cursor, and not have to put each percentage on a new line.

Can this be done with a "standard" C# console app?


Source: (StackOverflow)

How can you find out which process is listening on a port on Windows?

How can you find out which process is listening on a port on Windows?


Source: (StackOverflow)

Is there an equivalent of 'which' on the Windows command line?

As I sometimes have path problems, where one of my own cmd scripts is hidden (shadowed) by another program (earlier on the path), I would like to be able to find the full path to a program on the Windows command line, given just its name.

Is there an equivalent to the UNIX command 'which'?

On UNIX, which command prints the full path of the given command to easily find and repair these shadowing problems.


Source: (StackOverflow)

Batch file to delete files older than N days

I am looking for a way to delete all files older than 7 days in an MS-DOS batch file. I've searched around the web, and found some examples with hundreds of lines of code, and others that required installing extra command line utilities to accomplish the task.

Similar things can be done in BASH in just a couple lines of code. It seems that something at least remotely easy could be done for batch files in Windows. I'm looking for a solution that works in a standard Windows command prompt, without any extra utilities. Please no PowerShell or Cygwin either.


Source: (StackOverflow)

How do I shutdown - restart - logoff Windows via a bat file?

I've been using Remote Desktop Connection to get into a workstation, but I'm not able to use the shutdown/restart function in the Start menu while doing this.

I've put a few really helpful options in the answer below.

Note: I wanted to make sure some really good answers were also mentioned along with my own on this.

And here they are in no particular order.


Source: (StackOverflow)

Setting Windows PowerShell path variable

So I have found out that setting the PATH environment variable affects only the old command prompt. PowerShell seems to have different environment settings. How do I change the environment variables for PowerShell (v1)?

Note:

I want to make my changes permanent, so I don't have to set it every time I run PowerShell. Does PowerShell have a profile file? Something like Bash profile on Unix?


Source: (StackOverflow)

How to run a PowerShell script?

How do I run a PowerShell script?

  • I have a script named myscript.ps1
  • I have all the necessary frameworks installed
  • I set that execution policy thing
  • I have followed the instructions on this MSDN help page and am trying to run it like so: powershell.exe 'C:\my_path\yada_yada\run_import_script.ps1' (with or withot --noexit)

which returns exactly nothing, except that the file name is output. No error, no message, nothing. Oh, when I add -noexit, the same thing happens, but I remain within PowerShell and have to exit manually.

The ps1 file is supposed to run a program, and return the error level dependent on that program's output. But I'm quite sure I'm not even getting there yet.

What am I doing wrong?


Source: (StackOverflow)