I'm trying to create an noninvasive FAHClient.exe program in a CMD window, in the second virtual desktop in Windows 10; minimized; using files that can be ran without needing admin privileges.
To run an instance of FAHClient without needing admin privileges,
- download Winrar portable.
- Extract it to a folder somewhere.
- Then, download FAHClient.
- Open the winrar program, and extract the files within the 'latest.tar' file (located in your download directory), to a directory somewhere.
- Don't forget to modify config.xml, (example below)
- Create a .bat file with the right parameters to minimize the program (see below).
- Insert the file in 'Task Scheduler' to set to startup from boot.
- Create Powerscript files ??? <-- I need help here!
Code: Select all
<config>
<!-- Folding Slots -->
<slot id='0' type='CPU'/>
<gpu v='false'/>
<power v='FULL'/>
<passkey v='************************'/>
<team v='*****'/>
<user v='***************'/>
</config>
The .bat file, to boot FAH in a minimized Command window, looks like this:
Code: Select all
if not DEFINED IS_MINIMIZED set IS_MINIMIZED=1 && start "" /min "%~dpnx0" %* && exit
cmd /C "LOCATION\TO\FAHClient.exe"
exit
This batch file will just minimize the DOS version of FAHClient, in the first desktop, taking up valuable taskbar space, and will not move it to the second virtual desktop.
.bat files can be ran from boot, but have no control over the virtual desktop.
.ps1 (PowerShell script) files, have access to the virtual desktops, but can not be ran from boot.
However, it is possible to call upon a .ps1 file from within a .bat file.
The following link, gives 1 example file on how to start programs in a new desktop, and the other script file controls the desktop.
The 'VirtualDesktop.ps1' file needs to be located within the same directory, as the fah.ps1 file, for it to work (fah.ps1 being a modified example.ps1 file, that starts fahclient instead of notepad).
I have been able to create a new desktop, and run the batch file in the second desktop, but with following issues:
1- The PS1 file creates a new desktop every time it's called upon. I need to find a way to switch between desktops, without creating new ones, or I'll end up with many virtual desktops after multiple reboots.
2- The CMD file running FAH, closes after the PS1 file closes. The 'cmd /C' option (which should start a new instance of CMD) doesn't work here. I'm either able to run FahClient in the bat file minimized in the second desktop (and it won't shift back to the first desktop), or, I'm able to switch to desktop 2 and back with CMD closing...
Either solution is not acceptable.
Anyone with PowerShell experience here?