Skip to content

Commit

Permalink
NPMAsAdmin
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPlusGH committed Jun 23, 2020
1 parent f3c2083 commit d17486b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Binary file added NPMAsAdmin.lnk
Binary file not shown.
1 change: 1 addition & 0 deletions NPMAsAdmin.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Start-Process PowerShell -WorkingDirectory $pwd -Verb RunAs "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd';'$pwd'; & '.\NPlusMiner.ps1';`"";
4 changes: 2 additions & 2 deletions NPlusMiner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,8 @@ Add-Type -AssemblyName System.Windows.Forms
# $SwitchingArray = [System.Collections.ArrayList]@($Log)
If (Test-Path ".\Logs\switching.log"){$SwitchingArray = [System.Collections.ArrayList]@(Import-Csv ".\Logs\switching.log" | Select -Last 14)}

[environment]::currentdirectory = (Split-Path $script:MyInvocation.MyCommand.Path)

$MainForm = New-Object system.Windows.Forms.Form
$NPMIcon = New-Object system.drawing.icon (".\Includes\NPM.ICO")
$MainForm.Icon = $NPMIcon
Expand Down Expand Up @@ -2110,8 +2112,6 @@ $ButtonStart.Add_Click( {


$ShowWindow = Add-Type -MemberDefinition '[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);' -Name Win32ShowWindowAsync -Namespace Win32Functions -PassThru
$ParentPID = (Get-CimInstance -Class Win32_Process -Filter "ProcessID = $pid").ParentProcessId
$ConsoleHandle = (Get-Process -Id $ParentPID).MainWindowHandle
$ConsoleHandle = (Get-Process -Id $pid).MainWindowHandle

$MainForm.controls.AddRange($MainFormControls)
Expand Down

0 comments on commit d17486b

Please sign in to comment.