Category Archives: Windows knowhow

Howto do some things in Windows

Windows: Determine uptime from command line

Hi,

unlike Linux, Windows has no builtin uptime command to see when the operating system starts.

But nevertheless it’s possible. Use the systeminfo command.


c:\> systeminfo | findstr /i time
System Boot Time:          05.06.2014, 21:05:06
Time Zone:                 (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna

Note: If you have installed a language different then english replace time as filter which applies to your language.

Michael

Windows: Install a feature which is in State “removed”

Hi,

if a windows feature is in Install State removed, in this example the .NET Framework on Server 2012 R2.

PS C:\> Get-WindowsFeature *net*

Display Name                          Name                       Install State
------------                          ----                       -------------
.....
            [ ] ASP.NET 3.5           Web-Asp-Net                    Available
            [ ] ASP.NET 4.5           Web-Asp-Net45                  Available
[ ] .NET Framework 3.5 Features       NET-Framework-Features         Available
    [ ] .NET Framework 3.5 (inc....)  NET-Framework-Core             Removed
    [ ] HTTP Activation               NET-HTTP-Activation            Available
    [ ] Non-HTTP Activation           NET-Non-HTTP-Activ             Available
....

and if you try to install you’ll get an error message:
Continue reading Windows: Install a feature which is in State “removed”

Windows: No installation of Windows Updates at a policy defined scheduled date and time

Hi,

since Windows 8 respectively Server 2012 the policy to install Updates at a specific date and time has no affect.

Microsoft changed the behaviour for installing updates. The schedule for a installation and restart of updates is just defined by the deadline for Updates on the WSUS Server.
Continue reading Windows: No installation of Windows Updates at a policy defined scheduled date and time

Powershell: Error while calling the SaveAs Method of some Office Applications

Hi,

if you tried to save a word or excel document as another format you got an error. For example, if you want to convert a CSV File to a Excel workbook and save it in Excel 95/97/2003 format.

[reflection.assembly]::LoadWithPartialName("Microsoft.Office.InterOp.Excel")
$oExcel = New-Object -ComObject "Excel.Application"
$sCSVFile="D:\temp\ImportFile.csv"
$oExcel.Visible = $true
$oCSVWorkbook=$oExcel.Workbooks.Add()
$oExcel.Workbooks.OpenText($sCSVFile)
$oCSVWorkbook.SaveAs("D:\temp\test.xls",[Microsoft.Office.Interop.Excel.XlFileFormat]::xlExcel9795)
Exception calling "SaveAs" with "1" argument(s): "SaveAs method of Workbook class failed"
At D:\test\CSV2Excel.ps1:29 char:20
+ $xl_workbook.SaveAs <<<< ("D:\Temp\test.xls")
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation

Continue reading Powershell: Error while calling the SaveAs Method of some Office Applications

Windows: Hyper-V and Server Core start new cmd.exe

Hi,

you have closed the command shell window in your Session or you want to start an additional cmd shell or program?

At the console start the task Manager by pressing Alt-Ctrl-Del respectively if you are in a Remote Desktop Session Press Alt-Ctrl-End.

Start Task Manager
Start Task Manager

New Task
Continue reading Windows: Hyper-V and Server Core start new cmd.exe