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
21,550
questions
34
votes
1
answer
12k
views
Variables are not behaving as expected
I've been wrestling trying to get the syntax right on this batch file and I cannot figure out why some things aren't working.
The variable i is not getting incremented each time I do it.
...
80
votes
12
answers
117k
views
Arrays, linked lists and other data structures in cmd.exe (batch) script
I was playing with cmd.exe, but in its help I didn't find any info, how to define arrays.
I have found, how to define simple variables:
set a=10
echo %a%
But, I want to create arrays, linked list ...
190
votes
8
answers
95k
views
How does the Windows Command Interpreter (CMD.EXE) parse scripts?
I ran into ss64.com which provides good help regarding how to write batch scripts that the Windows Command Interpreter will run.
However, I have been unable to find a good explanation of the grammar ...
2753
votes
40
answers
3.4m
views
How do I install pip on Windows?
pip is a replacement for easy_install. But should I install pip using easy_install on Windows? Is there a better way?
21
votes
1
answer
36k
views
Single line with multiple commands using Windows batch file
I try to understand how multiple commands in a single command line in a batch file work.
dir & md folder1 & rename folder1 mainfolder
And other case with similar commands, but & ...
474
votes
24
answers
2.0m
views
How to add to the PYTHONPATH in Windows, so it finds my modules/packages? [duplicate]
I have a directory which hosts all of my Django apps (C:\My_Projects). I want to add this directory to my PYTHONPATH so I can call the apps directly.
I tried adding C:\My_Projects\; to my Windows ...
610
votes
30
answers
1.2m
views
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 ...
577
votes
42
answers
2.8m
views
'pip' is not recognized as an internal or external command
I'm running into a weird error when trying to install Django on my computer.
This is the sequence that I typed into my command line:
C:\Python34> python get-pip.py
Requirement already up-to-date: ...
9
votes
4
answers
78k
views
What is the reason for "X is not recognized as an internal or external command, operable program or batch file"?
I have a one-line snippet that works perfectly in the command line, but fails and throws up errors when I run it as part of a batch script.
The below commands behaves as expected, deleting all empty ...
880
votes
43
answers
960k
views
error: Unable to find vcvarsall.bat
I tried to install the Python package dulwich:
pip install dulwich
But I get a cryptic error message:
error: Unable to find vcvarsall.bat
The same happens if I try installing the package manually:
...
111
votes
4
answers
220k
views
Using UTF-8 Encoding (CHCP 65001) in Command Prompt / Windows Powershell (Windows 10)
I've been forcing the usage of chcp 65001 in Command Prompt and Windows Powershell for some time now, but judging by Q&A posts on SO and several other communities it seems like a dangerous and ...
739
votes
21
answers
2.3m
views
Adding a directory to the PATH environment variable in Windows
I am trying to add C:\xampp\php to my system PATH environment variable in Windows.
I have already added it using the Environment Variables dialog box.
But when I type into my console:
C:\>path
it ...
637
votes
30
answers
1.7m
views
How do I get current date/time on the Windows command line in a suitable format for usage in a file/folder name?
Update: Now that it's 2016 I'd use PowerShell for this unless there's a really compelling backwards-compatible reason for it, particularly because of the regional settings issue with using date. See @...
210
votes
38
answers
406k
views
Is there a good Valgrind substitute for Windows?
I was looking into Valgrind to help improve my C coding/debugging when I discovered it is only for Linux - I have no other need or interest in moving my OS to Linux so I was wondering if there is a ...
863
votes
2
answers
374k
views
How do SO_REUSEADDR and SO_REUSEPORT differ?
The man pages and programmer documentations for the socket options SO_REUSEADDR and SO_REUSEPORT are different for different operating systems and often highly confusing. Some operating systems don't ...
1001
votes
41
answers
1.6m
views
Remove credentials from Git
I'm working with several repositories, but lately I was just working in our internal one and all was great.
Today I had to commit and push code into other one, but I'm having some troubles.
$ git ...
725
votes
11
answers
559k
views
CSV file written with Python has blank lines between each row
import csv
with open('thefile.csv', 'rb') as f:
data = list(csv.reader(f))
import collections
counter = collections.defaultdict(int)
for row in data:
counter[row[10]] += 1
with open(...
682
votes
20
answers
738k
views
What characters are forbidden in Windows and Linux directory names?
I know that / is illegal in Linux, and * " / \ < > : | ? are illegal in Windows.
What else am I missing? I need a comprehensive guide that also accounts for double-byte characters.
1270
votes
42
answers
1.1m
views
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 ...
2
votes
2
answers
2k
views
Powershell: null file always generated (output of Compare-Object)
The most popular answer for this question involves the following Windows powershell code (edited to fix a bug):
$file1 = Get-Content C:\temp\file1.txt
$file2 = Get-Content C:\temp\file2.txt
$...
3308
votes
34
answers
5.4m
views
How do I find out which process is listening on a TCP or UDP port on Windows? [closed]
How do I find out which process is listening on a TCP or UDP port on Windows?
498
votes
31
answers
1.0m
views
How can I clear the interpreter console?
Like most Python developers, I typically keep a console window open with the Python interpreter running to test commands, dir() stuff, help() stuff, etc.
Like any console, after a while the visible ...
419
votes
28
answers
453k
views
How do I watch a file for changes?
I have a log file being written by another process which I want to watch for changes. Each time a change occurs I'd like to read the new data in to do some processing on it.
What's the best way to do ...
715
votes
60
answers
2.1m
views
pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"
I am very new to Python and trying to > pip install linkchecker on Windows 7. Some notes:
pip install is failing no matter the package. For example, > pip install scrapy also results in the SSL ...
63
votes
5
answers
70k
views
Example of delayed expansion in batch file
Can someone give me an example of where a batch script would act differently with or without delayed expansion? Are there any situations where you would NOT want to use delayed expansion? Thanks.
755
votes
25
answers
1.4m
views
Batch file to delete files older than N days
I am looking for a way to delete all files older than 7 days in a batch file. I've searched around the web, and found some examples with hundreds of lines of code, and others that required installing ...
1247
votes
26
answers
1.0m
views
Git replacing LF with CRLF
On a Windows machine, I added some files using git add.
I got warnings saying:
LF will be replaced by CRLF
What are the ramifications of this conversion?
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?
...
480
votes
9
answers
1.0m
views
How to completely remove node.js from Windows
I uninstalled my previous version of node.js (0.8.11) and downloaded the latest, 0.10.24 from the node.js website and installed it. However, after running node --version, it still indicates that I'm ...
449
votes
23
answers
627k
views
How to convert DOS/Windows newline (CRLF) to Unix newline (LF)
How can I programmatically (not using vi) convert DOS/Windows newlines to Unix newlines?
The dos2unix and unix2dos commands are not available on certain systems.
How can I emulate them with commands ...
95
votes
14
answers
101k
views
How to make win32 console recognize ANSI/VT100 escape sequences in `c`?
I'm building a lightweight version of the ncurses library. So far, it works pretty well with VT100-compatible terminals, but win32 console fails to recognise the \033 code as the beginning of an ...
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 ...
228
votes
0
answers
315k
views
iPhone development on Windows [duplicate]
Possible Duplicate:
How can I develop for iPhone using a Windows development machine?
Is there a way to develop iPhone (iOS) applications on Windows? I really don't want to get yet another ...
177
votes
7
answers
244k
views
Elevating process privilege programmatically?
I'm trying to install a service using InstallUtil.exe but invoked through Process.Start. Here's the code:
ProcessStartInfo startInfo = new ProcessStartInfo (m_strInstallUtil, strExePath);
System....
138
votes
4
answers
33k
views
Why does Windows64 use a different calling convention from all other OSes on x86-64?
AMD has an ABI specification that describes the calling convention to use on x86-64. All OSes follow it, except for Windows which has it's own x86-64 calling convention. Why?
Does anyone know the ...
467
votes
24
answers
1.2m
views
Permanently add a directory to PYTHONPATH?
Whenever I use sys.path.append, the new directory will be added. However, once I close python, the list will revert to the previous (default?) values. How do I permanently add a directory to ...
140
votes
9
answers
86k
views
How do you fix "runtimeError: package fails to pass a sanity check" for numpy and pandas?
This is the error I am getting and, as far as I can tell, there is nothing useful on the error link to fix this.
RuntimeError: The current Numpy installation
('...\\venv\\lib\\site-packages\\numpy\\...
2835
votes
27
answers
891k
views
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 ...
1344
votes
24
answers
1.5m
views
How do I run two commands in one line in Windows CMD?
I want to run two commands in a Windows CMD console.
In Linux I would do it like this
touch thisfile ; ls -lstrh
How is it done on Windows?
149
votes
22
answers
612k
views
Adding Python to PATH on Windows
I've been trying to add the Python path to the command line on Windows, yet no matter the method I try, nothing seems to work. I've used the set command, I've tried adding it through the Edit ...
389
votes
9
answers
820k
views
How to set commands output as a variable in a batch file [duplicate]
Is it possible to set a statement's output of a batch file to a variable, for example:
findstr testing > %VARIABLE%
echo %VARIABLE%
19
votes
2
answers
102k
views
Symbol equivalent to NEQ, LSS, GTR, etc. in Windows batch files
In batch I always use == when using the if command. (For example: if "19"=="3" echo My computer doesnt know maths)
What about for all of the others (LSS, LEQ, NEQ, etc.)? Isn't there something like !=...
82
votes
15
answers
318k
views
Batch command date and time in file name
I am compressing files using WinZip on the command line. Since we archive on a daily basis, I am trying to add date and time to these files so that a new one is auto generated every time.
I use the ...
117
votes
5
answers
83k
views
Transitioning from Windows Forms to WPF
For a long time now, I have been stuck with Windows Forms development (started with VB6, and has continued through to C# .NET 4.5), and I have pretty much hit the limit of what Windows Forms can do, ...
284
votes
31
answers
256k
views
How do I copy a string to the clipboard?
I'm trying to make a basic Windows application that builds a string out of user input and then adds it to the clipboard. How do I copy a string to the clipboard using Python?
1041
votes
44
answers
1.7m
views
Can't start Eclipse - Java was started but returned exit code=13
I am trying to get my first taste of Android development using Eclipse. I ran into this problem when trying to run Eclipse, having installed version 4.2 only minutes ago.
After first trying to start ...
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 ...
79
votes
14
answers
141k
views
How to have multiple colors in a Windows batch file?
I was wondering if its possible to have different colored text on the same line in a Windows batch file, for example if it says
echo hi world
I want "hi" to be one color, and "world" to be another ...
486
votes
11
answers
428k
views
Why does the 260 character path length limit exist in Windows?
I have come up against this problem a few times at inopportune moments:
Trying to work on open source Java projects with deep paths
Storing deep Fitnesse wiki trees in source control
An error trying ...
246
votes
35
answers
362k
views
Key hash for Android-Facebook app
I'm working on an Android app, in which I want to integrate a Facebook
posting feature. I downloaded the Facebook-Android SDK, and I got
the readme.md (text file) in there, in which it is mentioned to ...