Archive for the ‘ Windows ’ Category

Backup / Restore startmenu design (Layout)

If you want to backup your startmenu layout you can export using:

1
export-startlayout –path C:\layout.xml

BUT,You can import a Start Menu layout using Group Policy Editor (gpedit). After importing the layout it will be fixed, that is you will not be able to change that layout by moving the tiles around.

or better yet copy it as below.

 

backup:

Files are saved in the location of the script.

1
2
Reg export ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount") ("backup_startmenu.reg") /y
Copy-Item ("$env:LOCALAPPDATA\Microsoft\Windows\Shell\DefaultLayouts.xml") -Destination ("backup_startmenu.xml")

 

restore:

1
2
3
Reg delete ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount") /f
Reg import ("backup_startmenu.reg")
Copy-Item ("backup_startmenu.xml") -Destination ("$env:LOCALAPPDATA\Microsoft\Windows\Shell\DefaultLayouts.xml")

 

All in one menu and options (save as anything.ps1)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#------------------------------------------------------------------------------
# AUTHOR(s):
# Kyle Wadman
# 12/2019
# -----------------------------------------------------------------------------
CLS
$Loop = $true
While ($Loop)
{
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Start | PowerShell Script menu
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CLS
write-host
write-host +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
write-host "Startmenu backup/restore | -V1.0 Windows 10"
write-host +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
write-host
write-host -ForegroundColor yellow "Your can use the export-startlayout command to complete this task but on importing back into the system,"
write-host -ForegroundColor yellow "your startmenu will be fixed to the exported design. This method doesn't restricted changes after."
write-host
write-host 'PLEASE SELECT AN OPTION '
write-host -ForegroundColor gray '------------------------------------------------'
write-host -ForegroundColor green 'B) BACKUP'
write-host -ForegroundColor gray '------------------------------------------------'
write-host -ForegroundColor cyan 'R) RESTORE'
write-host -ForegroundColor gray '------------------------------------------------'
write-host -ForegroundColor yellow 'X) Exit'
write-host

$opt = Read-Host "Select an option "
write-host $opt
switch ($opt)
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# End of | PowerShell Script menu
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

{
b { #BACKUP SCRIPT
CLS
write-host "Exporting Reg >"; Reg export ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount") ("backup_startmenu.reg") /y
write-host "Collect XML >"; try{Copy-Item ("$env:LOCALAPPDATA\Microsoft\Windows\Shell\DefaultLayouts.xml") -Destination ("backup_startmenu.xml")} #-ErrorAction SilentyContinue
catch{write-host "Failed to find XML"; pause; break}; write-host "The operation completed successfully."
write-host -BackgroundColor yellow -ForegroundColor red " All Done "
pause
}

r { #RESTORE SCRIPT
CLS
write-host "Clean reg >"; Reg delete ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount") /f
write-host "Import reg >"; Reg import ("backup_startmenu.reg")
write-host "Place XML >"; try{Copy-Item ("backup_startmenu.xml") -Destination ("$env:LOCALAPPDATA\Microsoft\Windows\Shell\DefaultLayouts.xml")}
catch{write-host "Failed to Place XML"; pause; break}; write-host "The operation completed successfully."

write-host -BackgroundColor yellow -ForegroundColor red " You now need to logout and back in to see the results. "
pause
}

x{#BYE
CLS
write-host "Goodbye, It was nice to see you today."
exit
}

}
}

 

I did find someone has built this process into an application here.  For coded requirements, you can thank me later.

Maybe for personal backups, check out the software version.

Print Friendly, PDF & Email

WMindows 10 Profile backup

It’s been a while and this is shortly explained but the following script is designed to backup a users profile in windows 10 (1903) but should work on all Windows 10.

Line 149: $var_backupRoot needs to be updated to a backup ROOT location.

Download File

 

 

 

 

 

 

 

 

Print Friendly, PDF & Email

Windows 10 “Just a Moment”

So I started my Windows 10 Golden image on 1607.  I upgraded to 1703 and then after deployment to the machine it gets stuck on “just a moment”.

Add the following to your unattended and all will be right with the world once more.

<OOBE>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Work</NetworkLocation>
<SkipMachineOOBE>true</SkipMachineOOBE>
<SkipUserOOBE>true</SkipUserOOBE>
</OOBE>

For more detail please see source

Print Friendly, PDF & Email

Windows 7, kick logged on users like XP did

This little program allows any user of the local admin group to log off a user who has locked their machine, just like in windows XP without using fast user switching. It basically takes seconds to install and when a user locks their machine, they get the message stating that user x has locked this machine … “This computer is locked. Only the logged on user can unlock the computer” and to unlock it you need to press control, alt, del and log in with the users details who have locked the machine.

 

Download Application & Code

Source site: View forum post

 

Print Friendly, PDF & Email

Check Windows 7 Activation Using VBS

So i had some issues trying to use windows activation and wanted to be able to report on the OS status using BGInfo.

My below script can be referenced  inside BGInfo.

I might be worth downloading WMI Code Creator v1.0 This can be used to show what other information is ready for the picking.

Editing the below script will be able to report on any of the records WMI can throw your way.

 

Copy and paste the following code into a new .vbs file


Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From SoftwareLicensingProduct")
Coltest = int(0)
IsWinActivated = True

For Each objitem In colItems
IF int(objitem.GracePeriodRemaining) = 0 Then Coltest = True else Coltest = False
IF Coltest = False then IsWinActivated = False
Next

IF IsWinActivated = False then
call echo "Failed"
ELSE
call echo "Successful"
END IF

Print Friendly, PDF & Email

Bring laptop in for maintenance (Build for windows 7 32/64)

Please Explain…

OK, So at work I was asked to devise a way to make users return their laptops to us in IT for maintenance reviews. Now if anyone else has tried to get users to return hardware of maintenance on their own, it’s impossible…

So I have created a script that disables user logins after a X number of days. They also receive warnings after a different X number of days.  In my environment the PC’s are not connected to the domain. they run Windows7 32-bit.

I would like to know if I could get this to work on a domain system, but I’m going to say no for now.. No user to lockout, but you could amend to corrupt some type of file.

Basicly, I have created a services that runs a script to check the current date is not grater than or equal to the date of lockout. The script then locks specific user accounts if the date is grater than or equal to today’s date. If it’s not grater than or equal to today’s date then it checks if the notify period is grater than or equal to today’s date. Again, if this is grater than or equal to today’s date it will start to display messages to the user. The background login wallpaper will also change to a warning. Once the lockout date as been reached or passed, the lockout action is committed and the users cannot login. The wallpaper on the login screen changes to access denied. Now the only user who can use the computer is the local administrator account.

So now they bring the PC back to you because it’s now useless to them in it’s current state. When you login it runs the notify.bat as it does when any user logs in, but instead or it’s normal action of displaying a pop-up message, it will reset the restriction an set the schedule back to X days in the future. This is because you logged in as administrator, not because you are an administrator of the PC.

This service will lock administrator accounts as well, it just works on username. So even if the user is a local admin, this will still work. Although they could go into the Win7Checker folder and edit the dates so to stop lockout. So a normal user account for users is best. The service runs as an administrator so can make changes that the current your can’t make.

There is also a grace of one extra login after expiry. this is to allow access if the PC have been off for months. It also allows updates of the wallpaper to take place.

Install Instructions…. — DOWNLOAD SOFTWARE

1. Download

2. Extract files to a temp folder

3. Run install.bat as an administrator user with elevated privileges.

NOTE: When installing on x64 OS take the (x86) off the Program files on install of the RKTools.exe


5. Navigate to the folder "c:\windows\system32\Win7Checker\"

6. Right Click run.bat and click properties

7. Under the General Tab, Click Unlock

8. Repeat steps 6 & 7 for notify.bat & doff.exe in the same folder.

9. Reboot And COMPLETE

10. Use the .psd (Adobe Photoshop 3 document) to create your own JPG messages..

NOTE: the JPG files have to be less than 256kb in size otherwise windows will not use it.

Files Explained…

Below is a basic idea of what each files does.

BackgroundDefault.jpg - Normal background wallpaper.

BackgroundDefault2.jpg - Warning Wallpaper.

BackgroundDefault3.jpg - Access Denied Wallpaper.

doff.exe - Required for processing the dates.

notify.bat - Display messages. Admin user login does a reset.

run.bat - service run script. Main processing script

date.txt - This holds the date of expiry

notify.txt - This holds the date of starting to notify user.

today.txt - This holds the current date for processing.

bginfo.txt - This holds a readable date of expiry, I use BGInfo to put this on the desktop wallpaper.
Print Friendly, PDF & Email

Windows 7 Desktop Icons Disappear

Issue:

  • Icons on my Windows7 desktop disappear

Microsoft Information:

Other Information:

1. Easy solution to shortcuts disappearing… create a folder on your desktop called Shortcuts and put all your desktop shortcuts in the folder.  Then “send” the shortcuts back to your desktop from the folder.  Now they won’t disappear because they are linked to the desktop not to the correct location.

2. PowerShell Amend

  • Navigate to “%SystemRoot%\diagnostics\scheduled\Maintenance”.
  • Take ownership of the file “TS_UnusedDesktopIcons.ps1” (else you will not have the permission to modify the file)
  • Comment out (with a #) the line 32 ($list = AttachTo-List $list $wmiLinkFile.Name)
  • Save…

BAT FILE FIX


@echo *************************************
@echo ** REMEMBER : Run as Administrator **
@echo *************************************
@pause
%SystemDrive%
cd \Windows\diagnostics\scheduled\Maintenance
takeown /F TS_BrokenShortcuts.ps1
icacls TS_BrokenShortcuts.ps1 /grant "%USERNAME%":F
@echo “”
@echo *****************************************************************
@echo ** Search for '-gt 4' and replace with '-gt 400' and then SAVE **
@echo *****************************************************************
@echo "pess to edit file"
@pause
notepad TS_BrokenShortcuts.ps1

Print Friendly, PDF & Email

Windows Auto Login

Copy the below text into a .reg file and edit as required.

This works on a std PC and a Domained Machine


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DisableCAD"=dword:00000001
"AutoAdminLogon"="1"
"ForceAutoLogon"="1"
"DefaultPassword"="PASSWORD"
"DefaultDomainName"="DOMAIN"
"DefaultUserName"="USERNAME"

Print Friendly, PDF & Email

Check Registry Settings

Paste the following text into a .vbs file and edit as required.

The code allows you to check registry settings


On Error Resume Next

sResults = ""

Set oWShell = CreateObject("Wscript.Shell")
Call GetAppVersion("Internet Explorer", "HKLM\SOFTWARE\Microsoft\Internet Explorer\Version")
Call  GetAppVersion("Java",  "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F83216016FF}\DisplayVersion")

msgbox sResults

Set oWShell = Nothing

Sub GetAppVersion(sApplication, sRegPath)
On Error Resume Next

sTemp = oWShell.RegRead(sRegPath)
If Err.Number <> 0 Then
sResults = sResults & "Version not found for " & sApplication & "." & vblf
Err.Clear
Else
sResults = sResults & sApplication & " Version: " & sTemp & vblf
End If
End Sub

Print Friendly, PDF & Email

Windows 7 GodMode

Windows Vista/7 God mode is a list of every config available(Windows)

  1. Create a new folder
  2. Rename the folder
    GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}
  3. The icon will change and your done.
Print Friendly, PDF & Email