I'm trying to create a script to execute a 16-bit application through NTVDM in a x86 Operating System.
This application uses network mapped drives to work, so these drives must be connected to function.
The problem comes when I try to execute this app" (executes through a bat), when I have 'compiled' the PowerShell script to an .exe file, (cant use the .ps1 because it's a WPF script that's distributed to multiple users and they mustn't access the code).
Whenever I run the app within the Powershell ISE it runs perfectly, but once I compile it to exe, it throws the same error as when there's no mapped drives.
I'm using Start-Process
cmdlet, tried using -PassThru
, -LoadUserProfile
, -NoNewEnvironment
and also tried executing CMD
calling the bat (with /c
and /k
):
This is what I tried with cmd:
Start-Process 'cmd' -ArgumentList "/c ""C:\Soft\X\System x.bat"""
Start-Process 'cmd' -ArgumentList "/k ""C:\Soft\X\System x.bat"""
And this is what I tried with Start-Process
:
Start-Process -FilePath 'C:\Soft\X\System x.bat'
Start-Process -FilePath 'C:\Soft\X\System x.bat' -PassThru
Start-Process -FilePath 'C:\Soft\X\System x.bat' -PassTrhu -LoadUserProfile
Start-Process -FilePath 'C:\Soft\X\System x.bat' -PassTrhu -NoNewEnvironment
Tried all these to no avail and I ran out of ideas. Couldn't find anything in web searches related to this.
EDIT2: Any ideas?