If you are looking for a really simple, free and portable ftp server for Windows, then visit StahlWorks.com and get their excellent Swiss File Knife. It’s a single, small executable with no dependencies that brings a ton of features. If you have it, just run …
sfk ftpserv -rw
… and enjoy your zero-install, ultra-portable ftp server!
February 24th, 2011 niels Mercurial is a really nice revision control tool, but unfortunately there are no portable binary packages for Windows. They do offer msi packages, though. But retrieving their content without actually installing the software is a bit tricky.
You can just unpack them using 7-zip, but you are likely to get garbage.
Using your favorite search engine, you will find suggestions to perform an administrative installation using msiexec /a. Well, don’t. That’s just a normal installation, but without the GUI of the installer being shown.
Fortunately, there is lessmsi. It allows to open, inspect and extract Windows Installer packages.
For TortoiseHG, download the binary .msi package from the Mercurial homepage. Run lessmsi, open the .msi package and select “extract”. Mercurial will be extracted to WheretherYouExtracted\SourceDir\PFiles\TortoiseHg, and the original folder layout of Mercurial will be preserved.
Lessmsi is provided under the MIT License and does not require installation. Just download, unzip and run it.
Microsoft added a new command line tool to Vista and Windows 7: clip.exe. This nifty little utility allows user to copy program output to the clipboard on the windows command line. Its usage is pretty straightforward:
dir | clip – copies the output of the dir command to the clipboard
clip < example.txt – copy the contents of the file example.txt to the clipboard
I came across a really annoying problem while using win32 sockets one of my bigger projects. In short, the VisualC compiler complained about redefinitions of basic Windows socket macros:
C:\sdk\windows\v6.0a\include\ws2def.h(91) : warning C4005: 'AF_IPX' : macro redefinition
C:\sdk\windows\v6.0a\include\winsock.h(460) : see previous definition of 'AF_IPX'
C:\sdk\windows\v6.0a\include\ws2def.h(124) : warning C4005: 'AF_MAX' : macro redefinition
C:\sdk\windows\v6.0a\include\winsock.h(479) : see previous definition of 'AF_MAX'
C:\sdk\windows\v6.0a\include\ws2def.h(163) : warning C4005: 'SO_DONTLINGER' : macro redefinition
C:\sdk\windows\v6.0a\include\winsock.h(402) : see previous definition of 'SO_DONTLINGER'
C:\sdk\windows\v6.0a\include\ws2def.h(206) : error C2011: 'sockaddr' : 'struct' type redefinition
C:\sdk\windows\v6.0a\include\winsock.h(485) : see declaration of 'sockaddr'
C:\sdk\windows\v6.0a\include\ws2def.h(384) : error C2143: syntax error : missing '}' before 'constant'
C:\sdk\windows\v6.0a\include\ws2def.h(384) : error C2143: syntax error : missing ';' before 'constant'
C:\sdk\windows\v6.0a\include\ws2def.h(384) : error C2059: syntax error : 'constant'
C:\sdk\windows\v6.0a\include\ws2def.h(437) : error C2143: syntax error : missing ';' before '}
(...)
Read more…
It’s pretty convenient to list and kill processes using ps and kill / pkill on *nix. Actually, you can do that on a Windows command line as well:
- tasklist: shows a list of all running processes
- taskkill: kills processes
Among other options, processes can be killed by their process ID (taskkill /PID 4711) and by the name of their executable (taskkill /IM firefox.exe).
So, if you have perl scripts running wild, just execute taskkill perl.exe to kill all of them down with a single command.
More lesser known Windows commands are described in this PDF.