Monday, July 29, 2019

How to use SSH on Windows 10 Home Edition

I tried setting up ssh using OpenSSH and powershell on a nextbook with Windows 10 home edition installed. An error resulted on powershell which merely stated that ssh service couldn't be started on the computer. There is a message in the control panel which says that remote connection to the computer is not supported in the current edition of windows. I'm guessing this is the reason I cannot setup an ssh service. If so, is there a way to support ssh on Windows 10 home edition?


Edit:
The error I'm receiving in powershell after trying, ' Start-Service sshd ', is as follows:
" Service 'sshd (sshd)' cannot be started due to the following error: Cannot start service sshd on Computer '.'. "


I went through the tutorial here: https://blogs.msdn.microsoft.com/powershell/2017/12/15/using-the-openssh-beta-in-windows-10-fall-creators-update-and-windows-server-1709/
and the error results from trying the Start-Service script near the bottom.

Sunday, July 28, 2019

Is there a way to toggle the Windows "compress this drive" command through a command prompt?



My friends laptop (a 64-bit Windows 7 Home Premium with 4GB RAM) was running slowly and she asked me to take a look at it. One of the things (besides that the disks had not been defragmented for a long time, and some other things) is that she had ticked the checkbox "Compress this drive to save disk space" on the OS disk.




Since this is one thing that could make the OS run a bit slower I decided to untick the checkbox. After starting the decompression process, Windows estimated that it would take 16 hours to complete. However about 30 minutes later the OS suddenly shut down.



After restarting the machine I noticed that about half of the top-level folders have been decompressed, and half have not. On the root level the "Compress this drive" checkbox is however unticked.



Is there a way to launch the decompression of files through e.g. a command prompt?


Answer



Yes, its called the "compact" command.





Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.



C:\Windows\system32>compact /?



Displays or alters the compression of files on NTFS partitions.



COMPACT [/C | /U] [/S[:dir]] [/A] [/I] [/F] [/Q] [filename [...]]



/C Compresses the specified files. Directories will be marked

so that files added afterward will be compressed.



/U Uncompresses the specified files. Directories will be marked
so that files added afterward will not be compressed.



/S Performs the specified operation on files in the given
directory and all subdirectories. Default "dir" is the
current directory.



/A Displays files with the hidden or system attributes. These

files are omitted by default.



/I Continues performing the specified operation even after errors
have occurred. By default, COMPACT stops when an error is
encountered.



/F Forces the compress operation on all specified files, even
those which are already compressed. Already-compressed files
are skipped by default.
/Q Reports only the most essential information.

filename Specifies a pattern, file, or directory.



Used without parameters, COMPACT displays the compression state of
the current directory and any files it contains. You may use multiple
filenames and wildcards. You must put spaces between multiple
parameters.




More information here


windows 7 - Why are the PATH environment variables handled differently when I run cmd.exe as admin?

Original post:


When I start cmd.exe normally, my PATH variable only contains the paths from the system environment variable. Only when I start cmd.exe as admin does PATH contain a concatenation of the system and user variable.


Why is that and what can I do to change that behavior?


User PATH variable:


C:\Program Files (x86)\OpenVPN\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files (x86)\Java\jre7\bin;C:\Users\user.name\AppData\Roaming\npm

System PATH variable:


C:\app\user.name\product\11.2.0\client_1;C:\app\user.name\product\11.2.0\client_1\bin;C:\Program Files (x86)\Common Files\GEFASOFT;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Intel\DMIX;C:\Program Files (x86)\Intel\Services\IPT\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;C:\Program Files (x86)\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\lynx\;%systemroot%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft Windows Performance Toolkit\;%systemroot%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\nodejs\

PATH content in cmd with admin:


C:\app\user.name\product\11.2.0\client_1;C:\app\user.name\product\11.2.0\client_1\bin;C:\Program Files (x86)\Common Files\GEFASOFT;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Intel\DMIX;C:\Program Files (x86)\Intel\Services\IPT\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;C:\Program Files (x86)\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\NTRU Cryptosystems\NTRUTCG Software Stack\bin\;C:\Program Files\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\lynx\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\nodejs\;C:\Program Files (x86)\OpenVPN\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files (x86)\Java\jre7\bin;C:\Users\user.name\AppData\Roaming\npm

PATH content in cmd without admin:


C:\app\user.name\product\11.2.0\client_1;C:\app\user.name\product\11.2.0\client_1\bin;C:\Program Files (x86)\Common Files\GEFASOFT;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Intel\DMIX;C:\Program Files (x86)\Intel\Services\IPT\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;C:\Program Files (x86)\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\NTRU Cryptosystems\NTRUTCG Software Stack\bin\;C:\Program Files\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\lynx\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\nodejs\

Also I'm logged in as an administrator and by "run as admin" I mean "run elevated", so it's always the same user.


Update:


The link suggested by smc in the comments mentions a size limit of the system PATH variable (1920) in Windows Server 2003 beyond which the two variables won't be merged. So I started testing, here are my results:



  • In non-elevated mode the combined size of the already expanded user and system path variables must not exceed 2045. 2045 + 1 (for the ";" Microsoft inserts between the two variables) = 2046, which (coincidentally?) seems to be an old command line length limitation in Windows 2000.

  • In elevated mode the full length of both variables (2047 each, at least in the UI) can be used.


Another difference I've noticed is that in non-elevated mode the only variable that gets expanded is %SystemRoot%. %UserProfile%, %AppData% etc. aren't expanded. Interestingly this behavior can also be seen in the environment variables UI editor: %SystemRoot% gets expanded in the overview while other variables do not. When using an elevated command prompt all variables get expanded. This is regardless of the length of the PATH variables.


So my question still stands: Why is there a difference between elevated and non-elevated mode?

Saturday, July 27, 2019

windows - RoboCopy unable to copy between a server on a domain to a computer in a workgroup

I have a RoboCopy problem and here is the scenario.


My server is running Windows Server Essentials 2012 R2. My laptop is running Windows 10 Technical Preview. The server is running as a domain controller but my computer is not joined to that domain.


I have a share on the server called "Pictures", so it's located at ~ \\192.168.1.10\Pictures which I have mapped as P: using an account tha thas Full Control privileges on that folder. I've been trying to mirror that folder to my local machine using the simple command:


RoboCopy P:\ "C:\Users\[MyUsername]\Pictures" /MIR


This always returns the error ERROR 5 (0x00000005) Accessing Destination Directory even though the destination directory is under my user account where I am the owner. I have tried using both an administrative command prompt as well as the standard user command prompt. Neither works :(


Using RoboCopy between two local folders using the Pictures folder as a destination works just fine, so I'm guessing this has something to do with domain permissions rather than the actual destination permissions.


P.S.


The funny thing is this worked just fine when my computer was using Windows 8 and connected to the Server Essentials using the Connector application without domain joining (The Connector app isn't available for Windows 10).


P.P.S


Copying directly in Windows Explorer works just fine, but I need RoboCopy since it's much more efficient at syncing large folders.


Any help would be appreciated.




Update


I am unable to try with a local user on the server since the server is a domain controller. I did however try to give the domain user I use to map the network drive on the workgroup machine full permissions on the folder as well as making him owner and still no dice. Here is the exact RoboCopy output:



-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : fimmtudagur, 25. júní 2015 21:40:01
Source : P:\
Dest : C:\Users\stefa\OneDrive\Pictures\
Files : *.*
Options : *.* /V /S /DCOPY:DA /COPY:DAT /R:1000000 /W:30
------------------------------------------------------------------------------
25 P:\
2015/06/25 21:40:02 ERROR 67 (0x00000043) Accessing Destination Directory C:\Users\stefa\OneDrive\Pictures\
The network name cannot be found.
Waiting 30 seconds...

Update 2
I'm fairly certain I have just hit a bug in Windows 10 (still there in 10159). When I try this on a Windows 8.1 machine (x64 as well as RT, clean install on both) by using robocopy over a mapped network drive or net use \\192.168.1.10\IPC$ ... everything works just fine. But using a Windows 10 client, this does not work. My theory is that either something is has broken in the way Robocopy does network copies in Windows 10 or something in the network stack in Windows 10 has broken RoboCopy.

partitioning - How can i make 2 partitions on my USB Stick and put ISOs in them?


Can i make 2 partitions and put 2 ISOs on them so when i boot into BIOS it says something like USB(1) for first partition and USB(2) for second?


Answer



When booting into BIOS, it will only recognise the USB as 1 device, no matter how many partitions you create.


However, you can possibly create a GRUB-like OS loader on the USB. Then, when you boot onto the USB, from there you can select the OS.


The tutorial below shows how to make dual-boot USB:


http://www.makeuseof.com/tag/how-to-install-multiple-bootable-operating-systems-on-one-usb-stick/


installation - Dialog box tells me there's a missing driver when installing 64-bit version of Windows 7



I'm trying to install Windows 7 64-bit on my computer (ASUS P6T Deluxe V2, one 80GB HDD and two 1 TB HDDs). When I'm supposed to select whether I want to Upgrade or do a Custom install, I get a dialog box telling me:




Load Driver



A required CD/DVD drive device driver is missing. If you have a driver floppy disk, CD, DVD, or USB flash drive, please insert it now.




Note: If the Windows installation media is in the CD/DVD drive, you can safely remove it for this step.




I've tried to reach this step using a 32-bit installation disc, but that doesn't generate this message at all. Through the command windows (shift-F10) I can reach all of my drives, including my optical drive, without any problems--so what kind of device driver is it the installation wants? I've tried all the obvious drivers on the CD that followed my motherboard, but I can't seem to find the right one. The problem is that I don't know what device I'm supposed to load the drivers for in the first place.



Can anyone help me?



Edit: It turned out that my downloaded image was corrupted. I borrowed a DVD from a friend of mine, which worked!


Answer



I've had this exact error message, and it was caused by some sort of error on the DVD that I burned (I had burned the DVD at the fastest supported speed).




I solved it by using a new blank DVD and burning the ISO at the slowest speed that the DVD burner supported.



I think when I burned the original DVD, it verified correctly. For some reason, it seems that the Windows 7 installer is more sensitive to media errors.


windows 10 - Storage Spaces Utilization Doesn't Make Sense

Here's my setup:


Windows 10



  • 1 2TB USB3 drive

  • 1 3TB USB3 drive

  • 3.59 TB Two way mirror storage space built from these drives


Previously I had 2x 2TB drives, but one failed, so the replacement is 3TB. I did the math on the utilization percentages of the individual drives and they're both equally loaded, but each at only half of the used amount of the pool. The storage space is using 1.59 TB of space, but each drive's individual utilization is only half of that.


Why is this? Shouldn't each drive be utilizing the full amount of the storage space's data? Shouldn't I be right at the limit of the first 2 TB drive and be in need of adding two more drives to expand storage capacity?

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...