-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOld_open_functions.ps1
31 lines (26 loc) · 1023 Bytes
/
Old_open_functions.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
function Local:OpenExplorer($cmdlet, $path_exp, $_maxWindows, [ref]$_windowsCounter){
if($_maxWindows -gt $_windowsCounter.Value){
$_windowsCounter.Value++
&($cmdlet) $path_exp
}
}
PrintPath $explorerPathsToOpen[0]
OpenExplorer "explorer" $explorerPathsToOpen[0].Key $maxWindows ([ref]$windowsCounter)
Start-Sleep -s 1
$exp_paths = $explorerPathsToOpen[1..$explorerPathsToOpen.Length]
foreach($epto in $exp_paths){
PrintPath $epto
OpenExplorer "ii" $epto.Key $maxWindows ([ref]$windowsCounter)
}
#####################################
function Local:OpenRegedit($_path, $_maxWindows, [ref]$_windowsCounter){
if($_maxWindows -gt $_windowsCounter.Value){
$_windowsCounter.Value++
$regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit"
$name = "LastKey"
New-ItemProperty -Path $regPath -Name $name -Value $_path -PropertyType String -Force | Out-Null
Start-Process RegEdit /m
Start-Sleep -s 1
}
}
OpenRegedit $reg $maxWindows ([ref]$windowsCounter)