The trick is to use the choice command; see [WayBack] if statement – How to ask for batch file user input with a timeout – Stack Overflow
–jeroen
Posted by jpluimers on 2019/05/14
The trick is to use the choice command; see [WayBack] if statement – How to ask for batch file user input with a timeout – Stack Overflow
–jeroen
Posted in Batch-Files, Development, Microsoft Surface on Windows 7, Power User, Scripting, Software Development, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1, Windows 9, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Vista, Windows XP | Leave a Comment »
Posted by jpluimers on 2019/05/10
A while ago, I was surprised that in a Windows VM running under VMware Fusion, the Ctrl-Click performed a right click, despite me having changed the configuration:
I was wrong, as I had forgotten I assigned the “Windows 8 Profile” tot hat VM (as it was running Windows 8.1), which had the Secondary Button still mapped to the Control+Primary Button:
Related:
Unlike OS X, most other operating systems require the use of multibutton mice. Most Mac users know you can ctrl-click to simulate a right click, and you can do that in Fusion as well. But what if you actually want to ctrl-click in the guest – say, to select multiple items in Explorer? In Fusion’s […]
–jeroen
Posted in Fusion, Power User, Virtualization, VMware, Windows | Leave a Comment »
Posted by jpluimers on 2019/04/15
Just when I thought I made a note of a password I hardly ever use, I didn’t, luckily this open source tools understands how to recover many kinds of passwords: AlessandroZ/LaZagne: Credentials recovery project.
–jeroen
Posted in *nix, *nix-tools, Chrome, Development, DVCS - Distributed Version Control, Firefox, git, Internet Explorer, Office, Opera, Outlook, Power User, Python, Scripting, Skype, Software Development, Source Code Management, Web Browsers, WiFi, Windows | Leave a Comment »
Posted by jpluimers on 2019/04/11
This so much reminds me of a struggle in the Toshiba Tecra 750CDT era: [WayBack] Delphi Code Monkey: Cool Advanced Troubleshooting Technique – WinDbg.
First about Warren’s issue:
His laptop froze only in Windows 10, but not Windows 7, after doing some debugging work. Display is on, but non-responsive. He ruled out a lot of things, thought it was a video issue, looked for pointers how to research it ending to force memory dumps by keyboard then running WinDbg to further pinpoint the cause.
He solved the issue by removing the Lenovo supplied Intel graphics driver and forcing the Intel HD Graphics 520 OEM drivers onto the system and posted a few interesting links:
Then some history:
Back in the 750CDT days, the problem was the combination of Toshiba using OEM S3 Virge/MX video drivers, Windows GDI and TImageList with a lot of images in them (basically: the component palette).
Result: interrupt freeze of the laptop, so not even mouse or keyword would work.
Solutions:
From then on, I’ve never developed on Windows 9x based systems any more, but Windows NT based systems (even though it was much harder to get drivers for all hardware components), this despite the fact that with Windows NT 4, Microsoft video drivers from ring 3 to ring 0 (they were at ring 3 until and including Windows NT 3.51 [Archive.is]). On the one hand the move to ring 0 caused more blue screens, on the other hand made it a lot harder to directly access hardware from user software running at ring 3.
–jeroen
Posted in Development, Power User, Software Development, Windows, Windows 10 | Leave a Comment »
Posted by jpluimers on 2019/03/25
[WayBack] Call Everything with search pattern as parameter? – voidtools forum:
C:\Program Files\Everything\Everything.exe -search """aaa bbb"""
The extra quotes are needed to get through 2 layers of de-quoting.
Related: [WayBack] How to apply quotes from the command line – voidtools forum
–jeroen
Posted in Everything by VoidTools, Power User, Windows | Leave a Comment »
Posted by jpluimers on 2019/03/22
Just out of curiosity, I wanted to try run a CHKDSK at boot time of a non-system disk.
The trick appears to be to ensure something locks the drive. An easy way to do that is have a command prompt open inside a directory on that drive.
The below example show just that: a regular command prompt locking the E: drive and an administrative command prompt scheduling the check at boot time:
Regular command prompt:
Microsoft Windows [Version 10.0.15063] (c) 2017 Microsoft Corporation. All rights reserved. C:\Users\jeroenp>e: E:\>cd $RECYCLE.BIN E:\$RECYCLE.BIN>
Administrative command prompt:
C:\WINDOWS\system32>chkdsk /R /F E: The type of the file system is NTFS. Chkdsk cannot run because the volume is in use by another process. Chkdsk may run if this volume is dismounted first. ALL OPENED HANDLES TO THIS VOLUME WOULD THEN BE INVALID. Would you like to force a dismount on this volume? (Y/N) n Chkdsk cannot run because the volume is in use by another process. Would you like to schedule this volume to be checked the next time the system restarts? (Y/N) y This volume will be checked the next time the system restarts. C:\WINDOWS\system32>
–jeroen
Posted in Power User, Windows, Windows 10, Windows 7, Windows 8, Windows 8.1 | Leave a Comment »
Posted by jpluimers on 2019/03/19
Based on [WayBack] How can I open a cmd window in a specific location? – Stack Overflow:
cmd /K "pushd ""D:\Versioned Stuff\wiert.me"""
The quoting is required for paths having spaces, so I always include them just in case I ever have a path with spaces.
If I want it with bash, then I run it as follows:
cmd /K "pushd ""D:\Versioned Stuff\wiert.me""" && "C:\Program Files\Git\bin\bash.exe"
Documentation: [WayBack] CD Change Directory – Windows CMD – SS64.com
–jeroen
Posted in CommandLine, Console (command prompt window), Development, Power User, Software Development, Windows | Leave a Comment »
Posted by jpluimers on 2019/03/13
Based on [WayBack] windows – How to run batch file command with elevated permissions? – Super User:
powershell -command "Start-Process cmd.exe -Verb runas"
This works better than "runas /user:administrator cmd.exe" as that forces to use the specific Administrator account, whereas the PowerShell way allows you to specify the actual account during elevation.
You can extend this to run a command with one or more parameters based on [WayBack] Launch Elevated CMD.exe from Powershell – Stack Overflow (thanks [WayBack] mklement0):
powershell -command "Start-Process cmd.exe -Verb runas -Args /k, call, goto-bin"
This will actually pass “call goto-bin” to cmd.exe which tries to execute the “goto-bin” command (which I have around on the PATH as goto-bin.bat).
You can either use comma-separated parameters or a quoted string. In this expansion, comma-separated is easier in this PowerShell construct.
–jeroen
Posted in Batch-Files, CommandLine, Console (command prompt window), Development, Power User, PowerShell, PowerShell, Scripting, Software Development, Windows | Leave a Comment »
Posted by jpluimers on 2019/03/11
I totally did not know that DOSKEY was part of CMD.EXE, but it is: [WayBack] How do I export the history from the Windows command line to a text file? – Super User
Even better: it can export the command history:
doskey /HISTORY > history.txt
Related:
/history : Displays all commands stored in memory. You can use a redirection symbol (>) with /history to redirect the list to a file. You can abbreviate /history as /h.
–jeroen
Posted in Console (command prompt window), Power User, Windows | Leave a Comment »
Posted by jpluimers on 2019/03/08
TL;DR:
/unique switch for sortuniq (in a default x64 install, it is at C:\Program Files\Git\usr\bin\uniq.exe)From [WayBack] sorting – Is there a Windows equivalent to the Unix uniq? – Super User
This works fine:
dir /s /b *0*.pas *1*.pas *2*.pas *3*.pas *4*.pas *5*.pas *6*.pas *7*.pas*8*.pas *9*.pas | sort /unique > pas-files-with-numeric-names.txt
I need remove duplicate lines from a text file, it is simple in Linux usingcat file.txt |sort | uniqwhen file.txt containsaaabbbaaacccIt will output aaabbbcccIs there a Windows
Posted in Development, Power User, Software Development, Windows, Windows Development | Leave a Comment »