Questions tagged [windows]

Writing software specific to the Microsoft Windows operating system: APIs, behaviours, etc. GENERAL WINDOWS SUPPORT IS OFF-TOPIC. Support questions may be asked on https://superuser.com

Filter by
Sorted by
Tagged with
372 votes
22 answers
598k views

Docker for Windows error: "Hardware assisted virtualization and data execution protection must be enabled in the BIOS"

I've installed Docker and I'm getting this error when I run the GUI: Hardware assisted virtualization and data execution protection must be enabled in the BIOS Seems like a bug since Docker ...
Julien's user avatar
  • 4,494
370 votes
21 answers
277k views

Python not working in the command line of git bash

Python will not run in git bash (Windows). When I type python in the command line, it takes me to a blank line without saying that it has entered python 2.7.10 like its does in Powershell. It doesn't ...
Caroline Morris's user avatar
367 votes
16 answers
1.3m views

Batch script loop

I need to execute a command 100-200 times, and so far my research indicates that I would either have to copy/paste 100 copies of this command, OR use a for loop, but the for loop expects a list of ...
Tom J Nowell's user avatar
  • 9,831
366 votes
14 answers
858k views

Windows shell command to get the full path to the current directory?

Is there a Windows command line command that I can use to get the full path to the current working directory? Also, how can I store this path inside a variable used in a batch file?
user62958's user avatar
  • 4,819
366 votes
8 answers
665k views

Run a task every x-minutes with Windows Task Scheduler [closed]

I'm trying to get Windows Task Scheduler to run a particular .exe every 10 minutes or so, but the options only allow for once a day execution. Is there a way I can get it to run a .exe every 10 or 20 ...
kacalapy's user avatar
  • 10k
363 votes
13 answers
546k views

What is the Windows equivalent of the diff command?

I know that there is a post similar to this : here. I tried using the comp command like it mentioned, but if I have two files, one with data like "abcd" and the other with data "abcde", it just says ...
wittythotha's user avatar
  • 4,026
362 votes
18 answers
1.6m views

Command line for looking at specific port

Is there a way to examine the status of a specific port from the Windows command line? I know I can use netstat to examine all ports but netstat is slow and looking at a specific port probably isn't.
user1580018's user avatar
  • 3,629
360 votes
6 answers
320k views

CSV in Python adding an extra carriage return, on Windows

import csv with open('test.csv', 'w') as outfile: writer = csv.writer(outfile, delimiter=',', quoting=csv.QUOTE_MINIMAL) writer.writerow(['hi', 'dude']) writer.writerow(['hi2', 'dude2']) ...
apalopohapa's user avatar
  • 5,103
360 votes
18 answers
187k views

Git symbolic links in Windows

Our developers use a mix of Windows and Unix-based OSes. Therefore, symbolic links created on Unix machines become a problem for Windows developers. In Windows (MSysGit), the symbolic link is ...
Ken Hirakawa's user avatar
  • 8,081
355 votes
30 answers
296k views

Easier way to debug a Windows service

Is there an easier way to step through the code than to start the service through the Windows Service Control Manager and then attaching the debugger to the thread? It's kind of cumbersome and I'm ...
353 votes
22 answers
989k views

How to run a makefile in Windows?

I have some demos that I downloaded and they come with a Makefile.win and a Makefile.sgi. How can I run these in Windows to compile the demos?
Kim's user avatar
  • 3,541
350 votes
26 answers
258k views

Batch script: how to check for admin rights

How do I check if the current batch script has admin rights? I know how to make it call itself with runas but not how to check for admin rights. The only solutions I've seen are crude hack jobs or ...
flacs's user avatar
  • 3,953
349 votes
11 answers
533k views

Is there replacement for cat on Windows

I need to join two binary files with a *.bat script on Windows. How can I achieve that?
Artem Tikhomirov's user avatar
347 votes
3 answers
834k views

How to get the system uptime in Windows? [closed]

I am using windows 7 and xp. I want to know the uptime of the system. What is the command / procedure for getting the uptime?
user avatar
346 votes
20 answers
1.4m views

How to grant permission to users for a directory using command line in Windows?

How can I grant permissions to a user on a directory (Read, Write, Modify) using the Windows command line?
Amitabh's user avatar
  • 60.1k
346 votes
14 answers
457k views

How do you run a Python script as a service in Windows?

I am sketching the architecture for a set of programs that share various interrelated objects stored in a database. I want one of the programs to act as a service which provides a higher level ...
Hanno Fietz's user avatar
  • 31.2k
341 votes
12 answers
505k views

What languages are Windows, Mac OS X and Linux written in?

I was just wondering who knows what programming languages Windows, Mac OS X and Linux are made up from and what languages are used for each part of the OS (ie: Kernel, plug-in architecture, GUI ...
Brock Woolf's user avatar
339 votes
13 answers
423k views

Modifying the "Path to executable" of a windows service

I'd like to modify the path to my application, but doing so breaks it because the service still points to the old location. By going to Administrative Tools > Services you can open a properties ...
GenericJon's user avatar
  • 8,876
331 votes
10 answers
372k views

Which comment style should I use in batch files?

I've been writing some batch files, and I ran into this user guide, which has been quite informative. One thing it showed me was that lines can be commented not just with REM, but also with ::. It ...
MikeFHay's user avatar
  • 8,729
327 votes
18 answers
839k views

How can you zip or unzip from the script using ONLY Windows' built-in capabilities?

In Windows you can zip some files by right click → Send to → Compressed (zipped) folder And unzip by double clicking on the .zip file and extract the files. Is there a way to apply ...
Roee Gavirel's user avatar
  • 19.2k
324 votes
20 answers
254k views

Wildcards in a Windows hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost. The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1....
EvilPuppetMaster's user avatar
323 votes
27 answers
647k views

Create an empty file on the commandline in windows (like the linux touch command)

On a windows machine I get this error 'touch' is not recognized as an internal or external command, operable program or batch file. I was following these instructions which seem to be linux specific,...
CuriousAboutNode's user avatar
322 votes
15 answers
629k views

Get encoding of a file in Windows

This isn't really a programming question, is there a command line or Windows tool (Windows 7) to get the current encoding of a text file? Sure I can write a little C# app but I wanted to know if there ...
TheWebGuy's user avatar
  • 11.9k
319 votes
9 answers
407k views

What exactly are DLL files, and how do they work?

How exactly do DLL files work? There seems to be an awful lot of them, but I don't know what they are or how they work. So, what's the deal with them?
stalepretzel's user avatar
  • 15.8k
319 votes
6 answers
334k views

How to change users in TortoiseSVN

I was setting up another user to use our SVN repository. He didn't have a username/password, so I logged in with my credentials. We now have a username/password for him. How do I get TortoiseSVN ...
Robert Deml's user avatar
  • 12.4k
317 votes
27 answers
458k views

How to echo with different colors in the Windows command line

I know that the color bf command sets the colors of the whole command line window but I wanted to to print one single line in a different color.
rui's user avatar
  • 11.2k
316 votes
15 answers
322k views

Is there a better Windows Console Window? [closed]

I find working on the command line in Windows frustrating, primarily because the console window is wretched to use compared to terminal applications on linux and OS X such as "rxvt", "xterm", or "...
Alana Storm's user avatar
313 votes
18 answers
958k views

Stop and Start a service via batch or cmd file?

How can I script a bat or cmd to stop and start a service reliably with error checking (or let me know that it wasn't successful for whatever reason)?
Keng's user avatar
  • 52.6k
312 votes
16 answers
693k views

Stop all instances of Node.js server

I have started a Node server through the plugin of an IDE. Unfortunately, I cannot use the IDE's terminal. So I tried to run the script from the command line. This is the problem - I am using the ...
KA.'s user avatar
  • 4,354
308 votes
10 answers
280k views

RuntimeError on windows trying python multiprocessing

I am trying my very first formal python program using Threading and Multiprocessing on a windows machine. I am unable to launch the processes though, with python giving the following message. The ...
NG Algo's user avatar
  • 3,760
307 votes
6 answers
450k views

How to do something to each file in a directory with a batch script

How do you iterate over each file in a directory with a .bat or .cmd file? For simplicity please provide an answer that just echoes the filename or file path.
Brian R. Bondy's user avatar
306 votes
20 answers
777k views

How to check if a process is running via a batch script

How can I check if an application is running from a batch (well cmd) file? I need to not launch another instance if a program is already running. (I can't change the app to make it single instance ...
Matt Lacey's user avatar
  • 65.8k
305 votes
21 answers
348k views

Keyboard shortcut to paste clipboard content into command prompt window (Win XP) [closed]

Is there a keyboard shortcut for pasting the content of the clipboard into a command prompt window on Windows XP (instead of using the right mouse button)? The typical Shift+Insert does not seem to ...
sme's user avatar
  • 5,673
305 votes
11 answers
439k views

Using port number in Windows host file [closed]

After installing TeamViewer, I have changed the wampserver port to 8080, so the address is http://localhost:8080. For the host file located at C:\WINDOWS\system32\drivers\etc\, I have also made the ...
Charles Yeung's user avatar
305 votes
3 answers
361k views

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 ...
user1256477's user avatar
304 votes
27 answers
456k views

Docker gets error "failed to compute cache key: not found" - runs fine in Visual Studio

I've generated a Dockerfile with Visual Studio. It runs in Visual Studio just fine and now I'm trying to build it from Windows itself (docker build ., and I tried many combinations). Yet I get the ...
Sjardi Djoy Willems's user avatar
302 votes
18 answers
495k views

What is the proper way to test if a parameter is empty in a batch file?

I need to test if a variable is set or not. I've tried several techniques but they seem to fail whenever %1 is surrounded by quotes such as the case when %1 is "c:\some path with spaces". ...
blak3r's user avatar
  • 16.3k
300 votes
22 answers
153k views

How do I start PowerShell from Windows Explorer?

Is there a way to start PowerShell in a specific folder from Windows Explorer, e.g. to right-click in a folder and have an option like "Open PowerShell in this Folder"? It's really annoying to have ...
Josh Kodroff's user avatar
  • 27.7k
300 votes
24 answers
391k views

Quickly create large file on a Windows system

In the same vein as Quickly create a large file on a Linux system, I'd like to quickly create a large file on a Windows system. By large I'm thinking 5 GB. The content doesn't matter. A built-in ...
Leigh Riffel's user avatar
  • 6,511
300 votes
7 answers
295k views

What encoding/code page is cmd.exe using?

When I open cmd.exe on Windows, what encoding is it using? How can I check which encoding it is currently using? Does it depend on my regional setting or are there any environment variables to check? ...
Dan Gøran Lunde's user avatar
297 votes
31 answers
229k views

How to detect Windows 64-bit platform with .NET?

In a .NET 2.0 C# application I use the following code to detect the operating system platform: string os_platform = System.Environment.OSVersion.Platform.ToString(); This returns "Win32NT". The ...
Marc's user avatar
  • 9,152
297 votes
12 answers
648k views

How do you loop through each line in a text file using a windows batch file?

I would like to know how to loop through each line in a text file using a Windows batch file and process each line of text in succession.
Mr. Kraus's user avatar
  • 8,025
297 votes
15 answers
341k views

What is the Windows version of cron? [closed]

A Google search turned up software that performs the same functions as cron, but nothing built into Windows. I'm running Windows XP Professional, but advice for any version of Windows would be ...
Thomas Owens's user avatar
296 votes
20 answers
334k views

Windows batch: echo without new line

What is the Windows batch equivalent of the Linux shell command echo -n which suppresses the newline at the end of the output? The idea is to write on the same line inside a loop.
gregseth's user avatar
  • 13.2k
292 votes
7 answers
1.7m views

Command to list all files in a folder as well as sub-folders in windows

I tried searching for a command that could list all the file in a directory as well as subfolders using a command prompt command. I have read the help for "dir" command but coudn't find what I was ...
user1760178's user avatar
  • 6,477
289 votes
7 answers
226k views

How to write a multiline command?

How do we extend a command to the next line? Basically what's the Windows alternative for Linux's: ls -l \ /usr/ Here we use backslashes to extend the command onto the next lines. What's the ...
Jigar's user avatar
  • 9,141
288 votes
28 answers
579k views

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 ...
288 votes
19 answers
406k views

Composer install error - requires ext_curl when it's actually enabled

I'm trying to install Facebook PHP SDK with Composer. This is what I get $ composer install Loading composer repositories with package information Installing dependencies (including require-dev) Your ...
Michal Artazov's user avatar
287 votes
9 answers
378k views

Signing a Windows EXE file

I have an EXE file that I should like to sign so that Windows will not warn the end user about an application from an "unknown publisher". I am not a Windows developer. The application in question is ...
Lasar's user avatar
  • 5,307
285 votes
25 answers
669k views

Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.

I'm trying to install PhoneGap and I'm getting the following error: Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions. ...
rrvasanth's user avatar
  • 2,881