Leaving HomeGroup in Windows 8/7 and deleting non-existing user names in “Shared with” menu

If you decided that you no longer want your computer joined to HomeGroup and it failed in previous attempts or you see non-existing user names in HomeGroup then do the following:

* Click on Leave the homegroup in Change homegroup settings

*  Select Leave the homegroup in new dialog windows

* After a moment click Finish and close HomeGroup window

* Delete all files in

C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\PeerNetworking

* Restart the PC

You should successfully leave HomeGroup now.

 

In order to remove non-existing  user names you should to do the above steps on every PC that joined HomeGroup and then do the following on every PC also:

* Run regedit

* If you never used Windows Registry Editor (Regedit) then read this first: http://www.techsupportalert.com/content/learn-how-use-windows-registry-editor-regedit-one-easy-lesson.htm

* Navigate to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IdentityStore\Cache\GlobalStore\IdentityCache

and remove keys with old UserName

* Restart the PC

 

When above steps done on every PC to remove non-existing  user names you can create new HomeGroup and join HomeGroup on other PCs.

Advertisements
Posted in HomeGroup, Win7, Win8, WinRT | Tagged | Leave a comment

How to move your OneDrive folder; Unable to move OneDrive folder; OneDrive Application/Properties window hanges

To move you need to have administrative privileges, you should be the owner or at least have Full control access permissions to new location

Steps to move:

  • Open Windows File Explorer window, right-click on OneDrive and select Properties
  • Under the Location tab, you’ll see current location of your OneDrive folder. To change this, click on Move… and choose the folder you want to move all of your OneDrive’s content
  • Click OK
  • It’ll prompt you if you want to move all files from current location to new location and click Yes
  • Let files get synced
  • Now the location is ready

 

Posted in Win8, WinRT | Tagged , , | Leave a comment

Nokia Lumia 1020 – Can’t select mp3 as custom ringtone

Use Nokia’s Ringtone Maker app to create ringtones and notification alerts from the music on your phone. Simply open the app, select your favorite song and save it as a ringtone.

Posted in 8, 8.1, Windows Phone | Tagged , , , , , | Leave a comment

Get Windows Experience Index (WEI) via PowerShell with WPF GUI on Win 7, 8 and 8.1


# http://msdn.microsoft.com/en-us/library/windows/hardware/hh825488.aspx -- WinSAT


[xml]$gl_szXaml = @"
<Window 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Windows Experience Index (WEI) Scores"
    Width="333" Height="451"
    Background="lightgray"
    WindowStartupLocation="CenterScreen" Topmost="True" ResizeMode="NoResize" ShowInTaskbar="True">
    <StackPanel> 
        <Grid Margin="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <TextBlock Grid.Column="0" Grid.Row="1" Text="CPU:" FontWeight="Bold" Margin="3" />
            <TextBlock Grid.Column="0" Grid.Row="2" Text="RAM:" FontWeight="Bold" Margin="3" />
            <TextBlock Grid.Column="0" Grid.Row="3" Text="Graphics:" FontWeight="Bold" Margin="3" />
            <TextBlock Grid.Column="0" Grid.Row="4" Text="Gaming graphics:" FontWeight="Bold" Margin="3" />
            <TextBlock Grid.Column="0" Grid.Row="5" Text="Primary hard disk:" FontWeight="Bold" Margin="3" />

            <TextBlock Grid.Column="1" Grid.Row="0" Text="Initial" FontWeight="Bold" Margin="3" />
            <TextBox x:Name="tbCpuScoreCurr" Grid.Column="1" Grid.Row="1" Text="{Binding CPUSCORE}" IsReadOnly="True" Margin="3" />
            <TextBox x:Name="tbRamScoreCurr" Grid.Column="1" Grid.Row="2" IsReadOnly="True" Margin="3" />
            <TextBox x:Name="tbGraphScoreCurr" Grid.Column="1" Grid.Row="3" IsReadOnly="True" Margin="3" />
            <TextBox x:Name="tbGraphGamingScoreCurr" Grid.Column="1" Grid.Row="4" IsReadOnly="True" Margin="3" />
            <TextBox x:Name="tbHddScoreCurr" Grid.Column="1" Grid.Row="5" IsReadOnly="True" Margin="3" />

            <TextBlock Grid.Column="2" Grid.Row="0" Text="Recent" FontWeight="Bold" Margin="3" />
            <TextBox x:Name="tbCpuScoreNew" Grid.Column="2" Grid.Row="1" IsReadOnly="True" Margin="3" />
            <TextBox x:Name="tbRamScoreNew" Grid.Column="2" Grid.Row="2" IsReadOnly="True" Margin="3" />
            <TextBox x:Name="tbGraphScoreNew" Grid.Column="2" Grid.Row="3" IsReadOnly="True" Margin="3" />
            <TextBox x:Name="tbGraphGamingScoreNew" Grid.Column="2" Grid.Row="4" IsReadOnly="True" Margin="3" />
            <TextBox x:Name="tbHddScoreNew" Grid.Column="2" Grid.Row="5" IsReadOnly="True" Margin="3" />
        </Grid>

        <TextBox x:Name="tbParms" />

        <Button x:Name="bttnRun" Content="Re-Run" />
        <ListBox x:Name="lbStatus" MinHeight="200" MaxHeight="200" />
    </StackPanel>
</Window>
"@


#####
## Funcs
#####

function Get-WinSAT-Report-Latest-Name () {
    $oFile = Get-ChildItem $gl_szWinSATReportPath | Sort-Object LastWriteTime -descending | Select-Object Name |
             Select-String -pattern "Formal.Assessment" | Select-Object -First 1

    return $oFile.Line
}

function Wait-For-WinSAT-Report () {
    $szOldName = Get-WinSAT-Report-Latest-Name

    do {
        Start-Sleep -s 10
        $szNewName = Get-WinSAT-Report-Latest-Name
    }
    while ($szOldName -eq $szNewName)
}

function Set-Gui-Scores-Curr () {
    $tbCpuScoreCurr = $gl_oWnd.FindName("tbCpuScoreCurr")
    $tbRamScoreCurr = $gl_oWnd.FindName("tbRamScoreCurr")
    $tbGraphScoreCurr = $gl_oWnd.FindName("tbGraphScoreCurr")
    $tbGraphGamingScoreCurr = $gl_oWnd.FindName("tbGraphGamingScoreCurr")
    $tbHddScoreCurr = $gl_oWnd.FindName("tbHddScoreCurr")

    $oScoresCurr = Get-WmiObject Win32_WinSat | SELECT-OBJECT CPUSCORE, MEMORYSCORE, GRAPHICSSCORE, D3DSCORE, DISKSCORE

    $tbCpuScoreCurr.DataContext = $oScoresCurr
    $tbRamScoreCurr.Text = $oScoresCurr.MEMORYSCORE
    $tbGraphScoreCurr.Text = $oScoresCurr.GRAPHICSSCORE
    $tbGraphGamingScoreCurr.Text = $oScoresCurr.D3DSCORE
    $tbHddScoreCurr.Text = $oScoresCurr.DISKSCORE
}

function Set-Gui-Scores-New () {
    $tbCpuScoreNew = $gl_oWnd.FindName("tbCpuScoreNew")
    $tbRamScoreNew = $gl_oWnd.FindName("tbRamScoreNew")
    $tbGraphScoreNew = $gl_oWnd.FindName("tbGraphScoreNew")
    $tbGraphGamingScoreNew = $gl_oWnd.FindName("tbGraphGamingScoreNew")
    $tbHddScoreNew = $gl_oWnd.FindName("tbHddScoreNew")

    $oScoresNew = Get-WmiObject Win32_WinSat | SELECT-OBJECT CPUSCORE, MEMORYSCORE, GRAPHICSSCORE, D3DSCORE, DISKSCORE

    $tbCpuScoreNew.Text = $oScoresNew.CPUSCORE
    $tbRamScoreNew.Text = $oScoresNew.MEMORYSCORE
    $tbGraphScoreNew.Text = $oScoresNew.GRAPHICSSCORE
    $tbGraphGamingScoreNew.Text = $oScoresNew.D3DSCORE
    $tbHddScoreNew.Text = $oScoresNew.DISKSCORE

    $szMsg = "CPU: {0}, RAM: {1}, GRF: {2}, Gaming GRF: {3}, HDD: {4}" -f $oScoresNew.CPUSCORE, $oScoresNew.MEMORYSCORE, $oScoresNew.GRAPHICSSCORE, $oScoresNew.D3DSCORE, $oScoresNew.DISKSCORE
    
    Set-Gui-Status ($szMsg)
}

function Set-Gui-Status ($szMsg) {
    $lbStatus = $gl_oWnd.FindName("lbStatus")

    $lbStatus.Items.Add($szMsg)
}


#####
## Main
#####

$gl_szSysRoot = [environment]::GetEnvironmentVariable("systemroot")
$gl_szWinSATReportPath = "$gl_szSysRoot\Performance\WinSAT\DataStore"

Add-Type -As PresentationFramework
$gl_oReader=(New-Object System.Xml.XmlNodeReader $gl_szXaml)
$gl_oWnd=[Windows.Markup.XamlReader]::Load($gl_oReader)

Set-Gui-Scores-Curr

$gl_bttnRun = $gl_oWnd.FindName("bttnRun")
$gl_bttnRun.Add_Click({
    $oStartTS = Get-Date
    Set-Gui-Status ("Test started: " + $oStartTS)

    $gl_oWnd.Topmost = $false

    $szCmd = "winsat formal "+ $gl_oWnd.FindName("tbParms").Text
    Set-Gui-Status ("cmd: "+ $szCmd)
    
    Invoke-Expression ($szCmd)

    Wait-For-WinSAT-Report

    $gl_oWnd.Topmost = $true

    Set-Gui-Scores-New

    $oEndTS = Get-Date
    Set-Gui-Status ("Test completed: " + $oEndTS)
    
    $oElapsedTime = $oEndTS - $oStartTS
    Set-Gui-Status ("Elapsed time: {0}:{1}:{2}.{3}" -f  $oElapsedTime.Hours, $oElapsedTime.Minutes, $oElapsedTime.Seconds, $oElapsedTime.Milliseconds)
    Set-Gui-Status ("")
})

$gl_oWnd.ShowDialog() | Out-Null

Posted in Powershell, Win7, Win8 | Tagged , , , , , | Leave a comment

ListView, ScrollViewer scrolling problem

ScrollIntoView doesn’t work if ListView embedded in ScrollViewer.

Here is the way to resolve it.

<ScrollViewer x:Name="svItems" Grid.Row="1">
   <ListView x:Name="lvItems"
      IsTabStop="False" SelectionMode="Single" IsSwipeEnabled="False"
      ItemTemplate="{StaticResource ItemTemplate}"
      FontFamily="Global User Interface"
      SelectionChanged="lvItems_SelectionChanged"
      Loaded="lvItems_Loaded" />
</ScrollViewer>

 

Scroll to the top

private void lvItems_Loaded(object sender, RoutedEventArgs e)
{
   // m_lItems is ObservableCollection<MyItemClass>

   m_lItems.CollectionChanged += (s, args) => lvItems_scrollIntoView();
}


private void lvItems_scrollIntoView()
{
   svItems.ChangeView(null, -svItems.VerticalOffset, null);
}

 

Scroll to selected item

var item = (FrameworkElement)
      lvItems.ContainerFromItem(lvItems.Items[indx]);

GeneralTransform oTrans = item.TransformToVisual(lvItems);
Point pt = oTrans.TransformPoint(new Point());

svItems.ChangeView(null, pt.Y, null);

 

Posted in Win8, WinRT | Tagged , , , , | Leave a comment

How to get hash value, hash code or checksum in Win8

The below code is an example of how to get hash code of file or string in Win8 using Extension Methods:

using Windows.Security.Cryptography;
using Windows.Security.Cryptography.Core;


namespace YourNS
{
   public static class StringExtensions
   {
      public static string GetHashValAsync(this string szData, string szAlgName, bool bRetHex)
      {
         IBuffer oBuffUtf8 = CryptographicBuffer.ConvertStringToBinary(szData, BinaryStringEncoding.Utf8);

         var oHasher = HashAlgorithmProvider.OpenAlgorithm(szAlgName);
         IBuffer oBuffHashed = oHasher.HashData(oBuffUtf8);

         return bRetHex ? CryptographicBuffer.EncodeToHexString(oBuffHashed) : CryptographicBuffer.EncodeToBase64String(oBuffHashed);
      }
   }


   public static class StorageFileExtensions
   {
      public async static Task<string> GetHashValAsync(this StorageFile oFile)
      {
         string szBuff = await oFile.ReadStringAsync();
         return szBuff.GetHashValAsync(Windows.Security.Cryptography.Core.HashAlgorithmNames.Sha256, false);
      }


      public async static Task<string> ReadStringAsync(this StorageFile oFile)
      {
         string szData = "";

         IBuffer oBuff = await FileIO.ReadBufferAsync(oFile);

         using (var oReader = DataReader.FromBuffer(oBuff))
         {
            byte[] aBytes = new byte[oReader.UnconsumedBufferLength];
            oReader.ReadBytes(aBytes);

            szData = Encoding.UTF8.GetString(aBytes, 0, aBytes.Length);
         }

         return szData;
      }
   }
}
Posted in Win8, WinRT | Tagged , , , , , | Leave a comment