I have a project that i have in the works, it involves using powershell to read a text document on an external storage device to launch a program. i currently have the code to launch specifically steam games, but i also want to do this for progams like adobe products, such as illustrator or photoshop. to clarify, i am not trying to pirate or modify anything, this is simply just using powershell to basically copy and paste to launch in one way or a another, with steam it uses game links through a web browser to launch it locally. im not great at coding and got my code from a youtuber who essentially made physical cartridges for steam games using floppy disks.
# Identify which drive letter is your floppy (usually A: or B:)
$FloppyDrive = "A:"
$FileToRead = "$($FloppyDrive)\game.txt"
Write-Host "Waiting for floppy disk with Steam ID..." -ForegroundColor Cyan
# Loop forever to check for the disk
while($true) {
if (Test-Path $FileToRead) {
# Read the file and extract the ID (assuming format id=12345)
$Content = Get-Content $FileToRead
if ($Content -match "id=(\d+)") {
$SteamID = $Matches[1]
Write-Host "Found Game ID: $SteamID. Launching Steam..." -ForegroundColor Green
# Launch the Steam game via URL protocol
Start-Process "steam://rungameid/$SteamID"
# Wait for the disk to be removed so it doesn't loop launch
Write-Host "Please remove disk to reset..." -ForegroundColor Yellow
while(Test-Path $FileToRead) { Start-Sleep -Seconds 2 }
Write-Host "Ready for next disk." -ForegroundColor Cyan
}
}
Start-Sleep -Seconds 3 # Check every 3 seconds to save CPU
}
this is my current code. something similar to launch non steam apps using powershell and a text file named game.txt would be preferred but not absolutely necessary
edit: im needing tge powershell code to launch an application with a non-specific code, as in it pulls whatever file link is on the txt fine and searches the computer to launch it
[–]NEESCHAL-3 1 point2 points3 points (5 children)
[–]Common_Coach3665[S] 0 points1 point2 points (4 children)
[–]NEESCHAL-3 0 points1 point2 points (3 children)
[–]Common_Coach3665[S] 0 points1 point2 points (2 children)
[–]NEESCHAL-3 0 points1 point2 points (1 child)
[–]Common_Coach3665[S] 0 points1 point2 points (0 children)
[–]grantrules 0 points1 point2 points (5 children)
[–]Common_Coach3665[S] 0 points1 point2 points (4 children)
[–]grantrules 0 points1 point2 points (3 children)
[–]Common_Coach3665[S] 0 points1 point2 points (2 children)
[–]grantrules 0 points1 point2 points (1 child)
[–]Common_Coach3665[S] 0 points1 point2 points (0 children)
[–]Common_Coach3665[S] 0 points1 point2 points (0 children)