Error message Can not find script file "C:\Windows\system32\elevate.vbs". Copied elevate files into Windows.
This is just the DLI command, but it should avoid the need for elevate files. Report back if successful. Want to know if it runs from a non-admin account with UAC enabled. Code: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\DLI] @="DLI" "icon"="shell32.dll,23" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\DLI\command] @="cmd /c start /b powershell -command \"$WID=[System.Security.Principal.WindowsIdentity]::GetCurrent();$WIP=new-object System.Security.Principal.WindowsPrincipal($WID);$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator;if ($WIP.IsInRole($adminRole)){}else{$newProcess = new-object System.Diagnostics.ProcessStartInfo 'PowerShell';$newProcess.Arguments = $myInvocation.MyCommand.Definition;$newProcess.Verb = 'runas';[System.Diagnostics.Process]::Start($newProcess);Write-Host 'Prompting for Elevation';exit;}wscript.exe C:\\Windows\\System32\\slmgr.vbs -dli\""
Works just fine thx I am on a windows 8.1 pro x64 dk system, and no problems. Will it be possible to add commands for office 2013 in the future? Like these: "cscript ospp.vbs /act" "cscript ospp.vbs /dstatus" Cheers
@Bornung1, sure why not. Guessing this ospp.vbs is in system32, if not, you'll need a re-write. Code: [HKEY_CLASSES_ROOT\Directory\Background\Shell\OFFICE_KMS] "MUIVerb"="Office Activator" "SubCommands"="OFFICE_ACT;|;OFFICE_STATUS" "Icon"="cmd.exe" "Position"="top" "HasLUAShield"="" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\OFFICE_ACT] @="Office Activation" "icon"="shell32.dll,104" "HasLUAShield"="" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\OFFICE_ACT\command] @="cmd /c start /b powershell -command \"$WID=[System.Security.Principal.WindowsIdentity]::GetCurrent();$WIP=new-object System.Security.Principal.WindowsPrincipal($WID);$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator;if ($WIP.IsInRole($adminRole)){}else{$newProcess = new-object System.Diagnostics.ProcessStartInfo 'PowerShell';$newProcess.Arguments = $myInvocation.MyCommand.Definition;$newProcess.Verb = 'runas';[System.Diagnostics.Process]::Start($newProcess);Write-Host 'Prompting for Elevation';exit;}cscript.exe ospp.vbs -act\"" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\OFFICE_STATUS] @="Office Activation Status" "icon"="shell32.dll,104" "HasLUAShield"="" [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\OFFICE_STATUS\command] @="cmd /c start /b powershell -command \"$WID=[System.Security.Principal.WindowsIdentity]::GetCurrent();$WIP=new-object System.Security.Principal.WindowsPrincipal($WID);$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator;if ($WIP.IsInRole($adminRole)){}else{$newProcess = new-object System.Diagnostics.ProcessStartInfo 'PowerShell';$newProcess.Arguments = $myInvocation.MyCommand.Definition;$newProcess.Verb = 'runas';[System.Diagnostics.Process]::Start($newProcess);Write-Host 'Prompting for Elevation';exit;}cscript.exe ospp.vbs -dstatus\"" If anyone running W10 finds any failures on the original SLMGR, let me know.
The snip I posted few days ago needs a re-write. See at the end of both of the long lines, look for the word wscript try replacing with cscript. Then re-merge the settings. (they'll overwrite) Code: wscript.exe C:\\Windows\\System32\\ospp.vbs -dstatus\"" Code: cscript.exe ospp.vbs -dstatus\"" Also I deleted the windows path, as I hear the file is not stored there. My guess it must be on the path variable somewhere in MS Office Program folder.
Hi Mr.Jinje The only problem i have now, is when i use the (Office commands). The powershell windows opens and closes real quick, so i have no chance for reading the information. Is it not possible to keep the window open, so i can read what it says? Just like the windows commands.
Not sure, maybe try with cmd /k to leave the window open. Code: cmd /k cscript.exe ospp.vbs -dstatus\""
Sir, Please re-write the script in full for office activation as in the case of windows activation. I have done all the changes as instructed by you. But still powershell assumes that ospp.vbs resides in windows\system32 folder. But you may not be unaware that ospp.vbs resides in the \Programfiles\Microsoft Office\office16 folder. Please re-write the script so that it works fine as in windows activation. And thanks for the wonderful job for the context menu activation options for windows.