• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
maxXPsoft

Add Right click .wim Windows 7 or Windows 8/8.1

110 posts in this topic

Oh. Do you have an older version without any Powershell in it then?

Also, just a cosmetic thing, but wouldn't you consider rewriting the file so commands are in the order they appear in the menu? Currently it can be pretty hard to find the appropriate lines if you want to change the whole thing a little.

Edited by TheWalrus
0

Share this post


Link to post
Share on other sites

Oh. Do you have an older version without any Powershell in it then?

Powershell does a get-wiminfo and creates the list we have now. I see "" around it but as I said dism don't play well with blank spaces

The old way had a line for each image and it was long and took up several slots in a list can only have 16 things

bp5r.jpg

Uploaded with ImageShack.us

I used this

@="cmd /c C:\\Windows\\System32\\Dism /mount-wim /wimfile:\"%1\" /index:1 /mountdir:C:\\zMountDir"

Edited by maxXPsoft
0

Share this post


Link to post
Share on other sites
; 08/8/2013;   Added reg scripts for Windows 8.1 with Windows Assessment and Deployment Kit (Windows ADK) for Windows 8.1 installed for both amd64 and x86;     C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit;     (ADK) http://www.microsoft.com/en-us/download/details.aspx?id=39306

WIMrightclick_ Install_8.1_amd64.reg

WIMrightclick_ Install_8.1_x86.reg

Dism no longer works from Windows 7 System32 on Windows 8.1 Preview. You will have to use the (ADK) from Windows 8.1.

It is backwards compatible so no problem using on your Windows 7 images

Link in my Sig or first Post

Edited by maxXPsoft
0

Share this post


Link to post
Share on other sites

Hey Max, found a newer method to get feedback during scripts. Won't work in W7, but does work in W8 and above. Basically the Out-Gridview has a new parameter (-passthru) in Powershell 3.0/4.0 which adds an OK/Cancel to the window. Allows for multiple item selection and directs input back into the pipeline. Been around since last year, but I never used it 'til recently.

Here is an example, it opens up a list of processes, allows you to choose a single or multiple processes, collects their names and loops through closing all the highlighted items. Probably be easy enough to drop the Get-WimInfo in place of the "Get-Process | Select-Object -Property Id,ProcessName" part of the command and the mounting bits later to generate a little GUI action.

http://forums.mydigitallife.info/threads/50445-Windows-8-1-Task-Manager-Problem?p=843819&viewfull=1#post843819

$KILLPROCESS = (Get-Process | Select-Object -Property Id,ProcessName | Out-GridView -passthru -Title "Wise Guy Process Killer").ProcessName;Get-Process $KILLPROCESS | ForEach-Object -Process {Stop-Process -Id $_.ID}#
Edited by MrJinje
0

Share this post


Link to post
Share on other sites

1

Edited by maxXPsoft
0

Share this post


Link to post
Share on other sites

$KILLPROCESS = (Get-Process | Select-Object -Property Id,ProcessName | Out-GridView -passthru -Title "Wise Guy Process Killer").ProcessName;Get-Process $KILLPROCESS | ForEach-Object -Process {Stop-Process -Id $_.ID}#

I've been trying to figure out how to add certain things to the registry with a reg script and change them if they 32 or 64 bit. example

C:\Program Files

C:\Program Files (x86)

I can get the processor but not this

Edited by maxXPsoft
0

Share this post


Link to post
Share on other sites

I've been trying to figure out how to add certain things to the registry with a reg script and change them if they 32 or 64 bit. example

C:\Program Files

C:\Program Files (x86)

I can get the processor but not this

Try this, it should pipe the (x86) path on x64 builds. Note: From powershell if the registry key does not exist it'll error on set-itemproperty, so we test-path beforehand to be safe.

If ((Get-WmiObject -class Win32_OperatingSystem | Select-Object OSArchitecture).OSArchitecture -eq "64-bit") {$PROGS = "C:\Program Files (x86)"}else{$PROGS = "C:\Program Files"}$PROGSIf ( -Not (Test-Path 'registry::HKEY_CURRENT_USER\Software\Jinje')) {New-Item -Path 'registry::HKEY_CURRENT_USER\Software\' -Name Jinje -Force;}Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\Software\Jinje' -Name $PROGS -Value 1;#
Unless I am mistaken and could have just used the new-itemproperty the whole time. Oh well getting late.

Here I am using null "" variables to toggle ($OFF / $ON) for something, in case you ever wanted to switch from a mounted image to an online image.

http://forums.mydigitallife.info/threads/48613-Aunty-Mel-s-Cheap-And-Nasty-SxS-File-Expander-(Updated-2013-09-29)?p=837143&viewfull=1#post837143

If ($radiobuttonOnline.Checked -eq $true){$On = " /online "}else{$On = ""}

If ($radiobuttonOffline.Checked -eq $true){$Off = " /Image:" + $MountPath + "\Windows "}else{$Off = ""}

and because they are toggled null, we can be lazy and send both variables into the command, knowing one of them would be blank.

$labelParse.text = "cscript.exe " + $MOVE + "\sxsextract.vbs" + $DEB + $VIC + $RES + $On + $Off + $textbox1.text + " " + $textbox2.text

Edited by MrJinje
0

Share this post


Link to post
Share on other sites

I could be wrong, but I think you can replace this:

If ( -Not (Test-Path 'registry::HKEY_CURRENT_USER\Software\Jinje')){New-Item -Path 'registry::HKEY_CURRENT_USER\Software\' -Name Jinje -Force;Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\Software\Jinje' -Name $PROGS -Value 1;}else{Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\Software\Jinje' -Name $PROGS -Value 1;}
with this:

If ( -Not (Test-Path 'registry::HKEY_CURRENT_USER\Software\Jinje')) {New-Item -Path 'registry::HKEY_CURRENT_USER\Software\' -Name Jinje -Force;}Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\Software\Jinje' -Name $PROGS -Value 1;
Correct?

Cheers and Regards

0

Share this post


Link to post
Share on other sites

with this:

If ( -Not (Test-Path 'registry::HKEY_CURRENT_USER\Software\Jinje')) {New-Item -Path 'registry::HKEY_CURRENT_USER\Software\' -Name Jinje -Force;}Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\Software\Jinje' -Name $PROGS -Value 1;
Correct?

Cheers and Regards

Good eye. I slapped that together pretty haphazardly. But then again, Max is entering them via a .reg file, so they will pre-exist, moot point.

Was reading here, just some info for me on the appcompatflags you've been using.

http://www.novell.com/support/kb/doc.php?id=7010269

Configuring Applications to Always Request Elevated Rights:
Programs can be configured to always request elevation on the user level via registry settings under HKCU. These registry settings are effective on the fly, so they can be set immediately prior to launching a particular application and even removed as soon as the application is launched, if so desired. Simply create a “String Value” under“HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers” for the full path to an executable with a value of “RUNASADMIN”. Below is an example for CMD.
Windows Registry Editor Version 5.00[HKEY_Current_User\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]"c:\\windows\\system32\\cmd.exe"="RUNASADMIN" 
Edited by MrJinje
0

Share this post


Link to post
Share on other sites

I started using this again, and was curious whether there was any other way to make wiminfo pause other than doing it with powershell. The window just flashes and disappears :(

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.