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

windows
Filter by
Sorted by
Tagged with
160 votes
5 answers
150k views

How do I register a custom URL protocol in Windows?

How do I register a custom protocol with Windows so that when clicking a link in an email or on a web page my application is opened and the parameters from the URL are passed to it?
lukeck's user avatar
  • 4,668
158 votes
8 answers
237k views

What is the bit size of long on 64-bit Windows?

Not to long ago, someone told me that long are not 64 bits on 64 bit machines and I should always use int. This did not make sense to me. I have seen docs (such as the one on Apple's official site) ...
user avatar
984 votes
7 answers
1.1m views

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 ...
Skrud's user avatar
  • 11.8k
242 votes
8 answers
159k views

How do I create my own URL protocol? (e.g. so://...) [closed]

I have seen: http://www... ftp://blah.blah... file://blah.blah... unreal://blah.blah... mailto://blah.blah... What is that first section where you see http and the like called? Can I register my ...
Michael Beck's user avatar
  • 2,835
972 votes
24 answers
1.2m views

Setting Windows PowerShell environment variables

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 ...
Vasil's user avatar
  • 37.2k
263 votes
25 answers
407k views

How to run multiple Python versions on Windows

I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and 2.5 for another. How can I specify which I want to use? I am working on Windows XP ...
Bilal Basharat's user avatar
201 votes
15 answers
406k views

How do I start a process from C#?

How do I start a process, such as launching a URL when the user clicks a button?
user avatar
268 votes
19 answers
384k views

How can I auto-elevate my batch file, so that it requests from UAC administrator rights if required?

I want my batch file to only run elevated. If not elevated, provide an option for the user to relaunch batch as elevated. I'm writing a batch file to set a system variable, copy two files to a ...
PDixon724's user avatar
  • 2,683
296 votes
20 answers
333k 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
232 votes
27 answers
454k views

How to keep a Python script output window open?

I have just started with Python. When I execute a python script file on Windows, the output window appears but instantaneously goes away. I need it to stay there so I can analyze my output. How can I ...
rohitmishra's user avatar
  • 8,899
195 votes
15 answers
425k views

How to completely uninstall Android Studio from windows(v10)?

I have already seen this question. But that's for Mac OS. I am using windows. Every time I create a new project or try to build/rebuild the project it freezes!! I have installed the latest version(9/...
log0's user avatar
  • 2,322
87 votes
15 answers
122k views

Non-blocking console input?

I am trying to make a simple IRC client in Python (as kind of a project while I learn the language). I have a loop that I use to receive and parse what the IRC server sends me, but if I use raw_input ...
ImTooStupidForThis's user avatar
90 votes
15 answers
272k views

How to run script with elevated privilege on windows

I am writing a pyqt application which require to execute admin task. I would prefer to start my script with elevate privilege. I am aware that this question is asked many times in SO or in other forum....
sundar_ima's user avatar
  • 3,788
359 votes
6 answers
319k 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,093
81 votes
12 answers
231k views

How To Run PHP From Windows Command Line in WAMPServer

I'm new to php and wanted to run php from command line. I have installed WAMP and set the "System Variables" to my php folder ( which is C:\wamp\bin\php\php5.4.3). When i go to Run -> CMD -> Type php ...
Daman's user avatar
  • 933
1348 votes
28 answers
3.6m views

How do I remove the process currently using a port on localhost in Windows? [closed]

How can I remove the current process/application which is already assigned to a port? For example: localhost:8080
KavinduWije's user avatar
  • 41.3k
124 votes
12 answers
155k views

Request UAC elevation from within a Python script?

I want my Python script to copy files on Vista. When I run it from a normal cmd.exe window, no errors are generated, yet the files are NOT copied. If I run cmd.exe "as administator" and then run my ...
jwfearn's user avatar
  • 29.2k
158 votes
9 answers
231k views

Accessing a Shared File (UNC) From a Remote, Non-Trusted Domain With Credentials

We've run into an interesting situation that needs solving, and my searches have turned up nill. I therefore appeal to the SO community for help. The issue is this: we have a need to programmatically ...
Randolpho's user avatar
  • 56k
661 votes
27 answers
2.0m views

Error "'git' is not recognized as an internal or external command"

I have an installation of Git for Windows, but when I try to use the git command in Command Prompt, I get the following error: 'git' is not recognized as an internal or external command, operable ...
Jason Kim's user avatar
  • 18.6k
452 votes
1 answer
457k views

The difference between the 'Local System' account and the 'Network Service' account?

I have written a Windows service that spawns a separate process. This process creates a COM object. If the service runs under the 'Local System' account everything works fine, but if the service runs ...
jmatthias's user avatar
  • 7,525
10 votes
4 answers
41k views

Python Ctypes - loading dll throws OSError: [WinError 193] %1 is not a valid Win32 application

I have tried to run an exemple of a python code that gets a function from a library using ctypes. The exemple can be found here. I followed the instruction and beside one minor modification, I have ...
Frédéric Girard's user avatar
322 votes
15 answers
628k 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
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
189 votes
17 answers
143k views

Open document with default OS application in Python, both in Windows and Mac OS

I need to be able to open a document using its default application in Windows and Mac OS. Basically, I want to do the same thing that happens when you double-click on the document icon in Explorer or ...
Abdullah Jibaly's user avatar
81 votes
6 answers
85k views

How do I hide the console when I use os.system() or subprocess.call()?

I wrote some statements like below: os.system(cmd) #do something subprocess.call('taskkill /F /IM exename.exe') both will pop up a console. How can I stop it from popping up the console?
Synapse's user avatar
  • 1,594
1482 votes
18 answers
1.3m views

Filename too long in Git for Windows

I'm using Git-1.9.0-preview20140217 for Windows. As I know, this release should fix the issue with too long filenames. But not for me. Surely I'm doing something wrong: I did git config core.longpaths ...
Papa Mufflon's user avatar
  • 18.8k
239 votes
16 answers
216k views

Best way to run scheduled tasks [closed]

Today we have built a console application for running the scheduled tasks for our ASP.NET website. But I think this approach is a bit error prone and difficult to maintain. How do you execute your ...
Niels Bosma's user avatar
  • 11.9k
538 votes
24 answers
600k views

Aliases in Windows command prompt

I have added notepad++.exe to my Path in environment variables. Now in command prompt, notepad++.exe filename.txt opens the filename.txt. But I want to do just np filename.txt to open the file. I ...
Romonov's user avatar
  • 8,365
206 votes
5 answers
290k views

pythonw.exe or python.exe?

Long story short: pythonw.exe does nothing, python.exe accepts nothing (which one should I use?) test.py: print "a" CMD window: C:\path>pythonw.exe test.py <BLANK LINE> C:\path> C:\...
itdoesntwork's user avatar
  • 4,726
67 votes
4 answers
31k views

pip how to remove incorrectly installed package with a leading dash: "-pkgname"

After running pip freeze I noticed the following warning on top of the list: WARNING: Could not parse requirement: -atplotlib So I checked the installed packages using pip list, and indeed the ...
CAPSLOCK's user avatar
  • 6,363
51 votes
2 answers
51k views

Windows Batch Variables Won't Set

I think I ran into a bug in Window's batch scripting. I cannot set variables that are in an expanded if statement. Here is an isolated part of my script: @echo off set success=1 set Version=12345 ...
Nyaarium's user avatar
  • 1,580
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,071
308 votes
10 answers
279k 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
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
89 votes
18 answers
390k views

I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."? [duplicate]

I have a Windows 10 PC and I want to install pyaudio to use it with my chatbot, powered by chatterbot. I tried 2 different ways to install pyaudio. The first way is doing this on the command prompt: ...
Waaberi Ibrahim's user avatar
848 votes
7 answers
681k views

How can I redirect Windows cmd standard output and standard error to a single file?

I'm trying to redirect all output (standard output and standard error) of a Windows command to a single file: C:\ cd \ dir 1> a.txt 2> a.txt Output: The process cannot access the file because ...
ripper234's user avatar
  • 226k
113 votes
5 answers
252k views

Why do I get a SyntaxError for a Unicode escape in my file path? [duplicate]

The folder I want to get to is called python and is on my desktop. I get the following error when I try to get to it >>> os.chdir('C:\Users\expoperialed\Desktop\Python') SyntaxError: (...
inspired's user avatar
  • 1,137
11 votes
1 answer
1k views

At which point does `for` or `for /R` enumerate the directory (tree)?

The command for can be used to enumerate a directory and apply (a) certain command(s) on each item. With the /R the same can be accomplished for a full directory tree. What happens when the content ...
aschipfl's user avatar
  • 34.4k
8 votes
2 answers
5k views

non resizable window border and positioning

If i create non-resizable JFrames, and windows Aero is enabled setLocation does not seem to take account of the window border correctly. In the following code I would expect the second frame to be ...
msam's user avatar
  • 4,259
275 votes
12 answers
444k views

How to check for DLL dependency?

Sometimes when I'm doing a little project I'm not careful enough and accidentally add a dependency for a DLL that I am not aware of. When I ship this program to a friend or other people, "it doesn't ...
orlp's user avatar
  • 114k
181 votes
27 answers
196k views

How do I check if a given string is a legal/valid file name under Windows?

I want to include a batch file rename functionality in my application. A user can type a destination filename pattern and (after replacing some wildcards in the pattern) I need to check if it's going ...
tomash's user avatar
  • 12.9k
112 votes
18 answers
139k views

Can I send a ctrl-C (SIGINT) to an application on Windows?

I have (in the past) written cross-platform (Windows/Unix) applications which, when started from the command line, handled a user-typed Ctrl-C combination in the same way (i.e. to terminate the ...
Matthew Murdoch's user avatar
105 votes
13 answers
76k views

ExecJS::RuntimeError on Windows trying to follow rubytutorial

UPDATE: Colin's suggestion of removing the line //= require_tree . has fixed the issue. I have wasted over 2 days trying to follow every suggestion out there and fix my issue. I am trying to follow ...
user1687078's user avatar
  • 1,373
970 votes
39 answers
1.6m views

Failed to load the JNI shared Library (JDK)

When I try opening Eclipse, a pop-up dialog states: Failed to load the JNI shared library "C:/JDK/bin/client/jvm.dll"`. Following this, Eclipse force closes. Here's a few points I'd like to make: ...
316 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
194 votes
16 answers
314k views

Is there any sed like utility for cmd.exe? [closed]

I want to programmatically edit file content using windows command line (cmd.exe). In *nix there is sed for this tasks. Are there any useful native equivalents (cmd or ps) in windows?
Jakub Šturc's user avatar
  • 35.4k
112 votes
19 answers
934k views

PermissionError: [Errno 13] Permission denied

I'm getting this error : Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinter\__init__.py", line 1538, in __call__ return self.func(*args) File &...
Marc Schmitt's user avatar
  • 1,359
657 votes
34 answers
573k views

How do I measure execution time of a command on the Windows command line?

Is there a built-in way to measure execution time of a command on the Windows command line?
Kuroki Kaze's user avatar
  • 8,321
129 votes
7 answers
274k views

How to launch an application from a browser?

Is it possible to launch an application from a browser? I am not talking about opening a file from a browser (like open a PDF with Adobe Reader), but rather opening a new (blank) instance of an ...
Goro's user avatar
  • 10.1k
98 votes
24 answers
257k views

Python - PIP install trouble shooting - PermissionError: [WinError 5] Access is denied

I get the following error when using PIP to either install new packages or even upgrade pip itself to the latest version. I am running pip on a windows 8.1 machine with Python 3.4. The message is ...
Dave Mansfield's user avatar