recentpopularlog in

kme : windows   1018

« earlier  
Could you include manpages for the included programs? · Issue #696 · git-for-windows/git · GitHub
Rather than wasting your good karma by talking ill about developers from whose work you benefit handsomely every day, you might want to simply execute these commands once, and have your wish fulfilled:
<code class="language-bash">printf '#!/bin/sh\n\nexec more "${1%%.html}.txt"\n' >~/bin/git-doc-viewer
git config --global web.browser=more
git config --global browser.more.cmd="$HOME/bin/git-doc-viewer"</code>
git  windows  gitforwindows  git-bash  maybesolution 
9 weeks ago by kme
Windows10 Cursors Cursor | http://www.rw-designer.com/
This is a .ico file; I used an old version of IcoFX (from PortableApps.com) to open it and export PNGs.
windows  cursor  icon  clipart  design  solution 
10 weeks ago by kme
Troubleshooting the Windows Subsystem for Linux | Microsoft Docs | https://docs.microsoft.com/
Do this is an admin PowerShell
<code class="language-powershell">
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
</code>
windows  wsl  linux  virtualization  troubleshooting 
january 2020 by kme
Hashing it Out in PowerShell: Using Get-FileHash | https://www.petri.com/
Windows 7, even with all the updates, only has PowerShell 2.0, so no 'get-filehash' for Windows 7.
PowerShell 4.0 introduced a new cmdlet, Get-FileHash, primarily for use with Desired State Configuration (DSC). In a pull server configuration, you need to provide file hashes so that servers can recognize changes. That is the primary purpose of a file hash as far as I am concerned is for file integrity. Windows supports several different hashing algorithms, which you should not confuse with encryption.
powershell  hash  checksum  crypto  windows  win7  shellscripting 
january 2020 by kme
How to add separator in powershell - Stack Overflow
Basically, use 'export-csv' or 'converto-csv' with a '-delimiter' option.
csv  windows  powershell  shellscripting  textprocessing  newbie  solution 
january 2020 by kme
.net - What does $_ TRULY mean in PowerShell? - Stack Overflow
The $_ is only created in the context of a pipeline, that is the passing of output objects from one command into the "input" of another. For pipeline filters (which are like functions), powershell automatically populates the $_ variable with the current object of the pipeline. Now I say current because it is important to note that when multiple objects are passed down the pipeline, the process scriptblock of your filter is executed once per object.
windows  powershell  shellscripting  iteration  pipes  syntax  newbie  solution 
january 2020 by kme
syntax - What does "%" (percent) do in PowerShell? - Stack Overflow
When used in the context of a cmdlet (such as your example), it's an alias for ForEach-Object:
windows  powershell  shellscripting  syntax  newbie  solution 
january 2020 by kme
The Complete Guide to PowerShell Punctuation - Simple Talk
Backtick is backslash, basically, including for line continuation. Bad choice if you ask me, because it's not visually distinctive enough. It looks like crumbs in your code.
powershell  windows  shellscripting  syntax  grammar  explained  reference  newbie 
january 2020 by kme
How to get a comma separated table of installed Windows programs using PowerShell? - Stack Overflow
<code class="lang-powershell">Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |
Select-Object DisplayName, DisplayVersion |
ConvertTo-Csv -NoTypeInformation</code>
windows  sysadmin  softwaremanagement  powershell  shellscripting  solution 
january 2020 by kme
In Powershell, how do I concatenate one property of an array of objects into a string? - Stack Overflow | https://stackoverflow.com/
What I was actually looking for was like Awk with a specific RS. I ended up using `write-host` in a subexpression, something like this:

<code class="language-powershell">
gci -recurse -include *.exe,*.msi |
%{ get-filehash $_ -a SHA1 } |
%{ write-host $(
$_.hash + " " +
$(Resolve-Path -Relative $_.path | %{$_ -split "\\" -join "/"})
)
}
</code>

I think either 'convertto-csv' or 'export-csv' with '-delimiter' might work, though.

Note that 'get-filehash' doesn't seem to work on Windows 7 (as shipped, even with all current updates). It was introduced in PowerShell 4.0, and who knows what OS got that first (8, 10?).
windows  shellscripting  powershell  stringmanipulation  textprocessing  sortof  solution 
january 2020 by kme
PowerShell command to split from output - Stack Overflow | https://stackoverflow.com/
<code class="language-powershell">
Get-Content Carlist.txt | select-string carId | Foreach-Object { $_.ToString().split(':')[1] -replace '\s','' }
</code>
powershell  windows  textprocessing  shellscripting  solution 
january 2020 by kme
10 Ways to Open the Command Prompt in Windows 10 | https://www.howtogeek.com/
Right-clicking on the Start menu now shows 'PowerShell' instead of 'Command Prompt' options, as of the "Creators" update.
windows  sysadmin  powershell  commandprompt  cmd  newbie  howto 
january 2020 by kme
powershell - Get relative path of files in sub-folders from the current directory - Stack Overflow
The Resolve-Path cmdlet has a -Relative parameter that will return a path relative to the current directory:
<code class="language-powershell">
Set-Location C:\MyScript
$relativePath = Get-Item Data\Test.txt | Resolve-Path -Relative
</code>
powershell  relativepathname  shellscripting  scripting  windows  solution 
january 2020 by kme
move - Get-ChildItem results looks like relative paths in Powershell - Stack Overflow
A useful example of 'foreach':
<code class="language-powershell">
Get-ChildItem -recurse -path sub\WORK -filter "* OK" |
Where-Object { $_.PSIsContiner } |
foreach { Move-Item -path $_.Fullname -destination sub\OK }
</code>
powershell  shellscripting  scripting  windows  relativepathnames  samplecode 
january 2020 by kme
How to Delete Recovery Partition in Windows 7/8/10 (Solved)
One time I had this Windows (VM) where the recovery partition was *after* the C: partition, preventing me from resizing it. Disk Management snap-in prevents you from deleting this partition. Bullshit.

You can 'delete partition override' in DISKPART, though.
windows  win10  storage  diskmanagement  diskadministrator  sysadmin  solution 
january 2020 by kme
How To Disable AutoRun / AutoPlay In Windows 7 & Windows 8 | Redmond Pie
Create one of these two registry keys (all users or current user):
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\policies\Explorer\

Step 3: Within this subkey, locate the setting labeled “NoDriveTypeAutoRun”. If it doesn’t exist, create a new 32-bit DWORD with this name and assign it the hexadecimal value 000000FF (Decimal 255).
windows  win7  win8  win10  autorun  autoplay  security  movein  howto 
december 2019 by kme
HotSwap!
It does the same thing as you can remove device from Device Manager but it provides much friendly user interface as you remove the removable device from the "Safely Remove Hardware" icon in the notification area. It also ensures that all data are written and flushed to the disk before the device to be hot-swapped, so you can use SATA/eSATA drive as a removable device much alike USB/IEEE1394 drive.
windows  sata  esata  hotswap  devicemanager  utility  freeware  notificationicon 
december 2019 by kme
Cygwin no available download site - Stack Overflow
Solution for me (modern.ie Win7 VM on corporate network) was to go to https://cygwin.com/mirrors.html and pick one of the mirrors from there.
cygwin  windows  corporatenetwork  mirrors  networksettings  annoyance  workaround  solution 
october 2019 by kme
The Complete Guide to Creating Symbolic Links (aka Symlinks) on Windows
<code class="lang-batch">
:: Use /D when you want to create a soft link pointing
:: to a directory. like so:
mklink /D Link Target
</code>
symlink  junctionpoints  directoryjunction  hardlink  windows  sysadmin  cli  commandline  mklink  reference  solution  dammitbrain 
september 2019 by kme
windows - Run Python scripts in PowerShell directly - Super User
Edit the PATHEXT environment variable and add the .py extension.

Just add this line to your powershell profile:
<code class="language-powershell">$env:PATHEXT += ";.py"</code>

or you could just edit PATHEXT globally using the system settings (just start menu search for "Edit Environment variables for your account").


See https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles; the MS TechNet article linked in the approved answer is looooong dead.
python  powershell  windows  cli  commandline  pathext  path  environmentvariable  shellscripting  solution  essential  movein  configuration 
august 2019 by kme
windows - How do I use a pipe to redirect the output of one command to the input of another? - Stack Overflow
So it looks like you can't pipe the output of batch files into other programs with CMD.EXE, which I just... never noticed.

Workaround is to use PowerShell to run the whole pipeline, since it has proper pipes
You can also run exactly same command at Cmd.exe command-line using PowerShell. I'd go with this approach for simplicity...
<code class="language-powershell">PowerShell -Command "temperature | prismcom.exe usb"</code>

Please read up on Understanding the Windows PowerShell Pipeline

You can also type in C:\>PowerShell at the command-line and it'll put you in PS C:\> mode instanctly, where you can directly start writing PS.
windows  cli  cmd.exe  cmd  shellscripting  powershell  workaround  sortof  solution 
august 2019 by kme
Access clipboard in Windows batch file - Stack Overflow
tl;dr:
<code class="language-powershell">get-clipboard</code>

(works on Windows 10 at least)

The alternatives are ghastly:
Slimming it down (on a new enough version of Windows):
<code class="language-powershell">set _getclip=powershell "Add-Type -Assembly PresentationCore;[Windows.Clipboard]::GetText()"
for /f "eol=; tokens=*" %I in ('%_getclip%') do set CLIPBOARD_TEXT=%I</code>

- First line declares a powershell commandlet.
- Second line runs and captures the console output of this commandlet into the CLIPBOARD_TEXT enviroment variable (cmd.exe's closest way to do bash style backtick ` capture)


(and that was one of the _concise_ solutions)
windows  powershell  cli  shellscripting  clipboard  automation  ayfkm  microsoft  whynotpowershell  alternativeto  xclip  pbcopy  pbpaste 
august 2019 by kme
cmd - How can you get the clipboard contents with a Windows command? - Stack Overflow
<code class="language-dos">powershell -command "Get-Clipboard" > file.txt</code>

This cannot be stored in a DOSKEY macro, because those can't be used in pipes.
windows  cmd  powershell  clipboard  cli  automation  pipes  workaround  sortof  solution 
august 2019 by kme
Working on CityDesk, Part Five – Joel on Software
4. If You Can Only Do One Platform, Do Windows.

I’d love to have a Mac version and a Linux version, but they are not good uses of limited resources. Every dollar I invest in CityDesk Windows will earn me 20 times as many sales as a dollar invested in a hypothetical Mac version. Even if you assume that Mac has a higher percentage of creative and home users, I’m still going to sell a heck of a lot more copies on Windows than I could on Mac. And that means that to do a Mac version, the cost had better be under 10% of the cost of a Windows version. Unfortunately, that’s nowhere near true for CityDesk. We benefit from using libraries that are freely available on Windows (like the Jet multiuser ACID database engine and the DHTML edit control) for which there are no equivalents on the Macintosh. So if anything, a Mac port would cost more than the original Windows version. Until somebody does something about this fundamental economic truth, it’s hard to justify Mac versions from a business perspective. (Incidentally, I have said time and time again, if Apple wants to save the Mac, they have to change this equation.)

And don’t get me started about Linux. I don’t know of anyone making money off of Linux desktop software, and without making money, I can’t pay programmers and rent and buy computers and T1s. Despite romantic rhetoric, I really do need to pay the rent, so for now, you’re going to have to rely on college kids and the occasional charitable big company for your Linux software.
devel  gui  webui  webapps  windows  perspective  mac  crossplatform  economics 
july 2019 by kme
« earlier      
per page:    204080120160

Copy this bookmark:





to read