Using MKLink and WMIC in Run before.

RBCC

Member
Messages
44
Reaction score
0
I am trying to learn how to use Mklink and WMIC in run before login. Do I put the MKlink Commands and the WMIC Commands in a batch file or do Write them in a command in run before command structure?

wmic pagefileset delete
wmic pagefileset create name="T:\\pagefile.sys"
wmic pagefileset where name="T:\\pagefile.sys" set InitialSize=65536,MaximumSize=65536

and DISM /Online /Add-Capability /CapabilityName:WMIC~~~~

Also
MKLINK /J "C:\Program Files\WindowsApps\PointPlanck.FileBot_5.2.1.0_x64__49ex9gnthnt12" "A:\Applications\Video\Renamer\Point Planck\Filebot43038033-IPAYBTCR"
MKLINK /J "C:\Program Files (x86)\NCH Software\WavePad" "A:\Applications\Audio\Converter\NCH\Wavepad"
MKLINK /J "C:\Program Files (x86)\NCH Software\Switch" "A:\Applications\Audio\Converter\NCH\Switch"
MKLINK /J "C:\Program Files (x86)\NCH Software\Prism" "A:\Applications\Video\Converter\Prism"
MKLINK /J "C:\Program Files (x86)\NCH Software\VideoPad" "A:\Applications\Video\Converter\Video"


do I Make 1 batch file for mklink and 1 text for Wmic and put in command in run before /c DISM /Online /Add-Capability /CapabilityName:WMIC~~~~. How do i call in the batch that has the WMIC Commands . Please show how! Thank you .
 
WMIC is deprecated and disappearing soon. Now's the time to learn how to perform tasks without it.

Normally you could use NTLite to define all of the page file locations and sizes. But I suspect in your setup, there isn't a guarantee that drive T: is actually mapped to T: until later in the install process. So we can't use the built-in method under Settings / Tweaks.

Moving everything to a single PS script:
Code:
Get-CimInstance -ClassName Win32_ComputerSystem | Set-CimInstance -Property @{AutomaticManagedPagefile = $false}
Get-CimInstance -ClassName Win32_PageFileSetting | Remove-CimInstance
New-CimInstance -ClassName Win32_PageFileSetting -Property @{Name= "T:\pagefile.sys"} | Set-CimInstance -Property @{InitialSize=65536; MaximumSize=65536}

New-Item -ItemType Junction -Path "C:\Program Files\WindowsApps\PointPlanck.FileBot_5.2.1.0_x64__49ex9gnthnt12" -Target "A:\Applications\Video\Renamer\Point Planck\Filebot43038033-IPAYBTCR"
New-Item -ItemType Junction -Path "C:\Program Files (x86)\NCH Software\WavePad"  -Target "A:\Applications\Audio\Converter\NCH\Wavepad"
New-Item -ItemType Junction -Path "C:\Program Files (x86)\NCH Software\Switch"   -Target "A:\Applications\Audio\Converter\NCH\Switch"
New-Item -ItemType Junction -Path "C:\Program Files (x86)\NCH Software\Prism"    -Target "A:\Applications\Video\Converter\Prism"
New-Item -ItemType Junction -Path "C:\Program Files (x86)\NCH Software\VideoPad" -Target "A:\Applications\Video\Converter\Video"
 
Back
Top