latin625 Posted January 18, 2023 Share Posted January 18, 2023 Hi, I have this vbs script below that hides the cmd window when loading from LB or BB, but it stops LEDBlinky from keeping the button light on. Set WshShell = CreateObject("WScript.Shell") WshShell.Run chr(34) & "lair.bat" & Chr(34), 0 Set WshShell = Nothing When I dont use the script and go with a bat file, I lose focus of the game screen and have to click on the mouse to get it focused again. Any ideas on how to get this to work? Thanks Quote Link to comment Share on other sites More sharing options...
latin625 Posted January 18, 2023 Author Share Posted January 18, 2023 Solved. In case anyone needs to hide CMD but keep focus on emulator. I used hypseus.exe (The program to return to focus on) as the sample below: Set WshShell = CreateObject("WScript.Shell") Dim ObjShell :Set ObjShell = CreateObject("Wscript.Shell") WshShell.Run chr(34) & "lair.bat" & Chr(34), 0 ObjShell.AppActivate("hypseus") 1 Quote Link to comment Share on other sites More sharing options...
Headrush69 Posted January 18, 2023 Share Posted January 18, 2023 I'm just in the process of redoing all my Hypseus and Singe2 games, so haven't tested everything with LEDBlinky and focus issues yet, but a few questions/suggestions: You seem to create 2 Wscript.Shell objects in the first 2 lines, is that needed? Instead of calling your command BAT file can you not call hypseus directly eliminating the extra process? Something like this: Quote Dim oShell : Set oShell = CreateObject ("Wscript.Shell") oShell.Run "cmd /c hypseus.exe lair vldp -framefile framefile\lair.txt -fullscreen -blank_searches -min_seek_delay 1000 -seek_frames_per_ms 20 -fastboot -bank 0 11001000 -bank 1 00100011 -latency 950", 1, true FYI, I haven't fully test this yet as long as LB calls LedBlinky before starting Hypseus this should work. (If not might have to modify) Quote Link to comment Share on other sites More sharing options...
JoeViking245 Posted January 18, 2023 Share Posted January 18, 2023 If you only need to hide the command window that comes up when running a batch file, you could (as an option) create a shortcut to the batch file right click the shortcut and select Properties Next to the Run option, select Minimized Click OK to save and close Now run (point to) the shortcut instead of the batch file itself. Quote Link to comment Share on other sites More sharing options...
latin625 Posted January 18, 2023 Author Share Posted January 18, 2023 @Headrush69 Unfortunately, I have super limited skills with this and "ugly fixed" the issue. Wouldn't know enough to be able to tell you if it is required, but I can say it works 100%. If you want to streamline it, please have at it. Would love to have something correct and efficient if it is possible. Apologies in advance. Quote Link to comment Share on other sites More sharing options...
latin625 Posted January 18, 2023 Author Share Posted January 18, 2023 @JoeViking245 Tried that initially, but it would not work and LEDBlinky would not flash or keep the button lit. For me, it did not work with LEDBlinky. Thanks, 1 Quote Link to comment Share on other sites More sharing options...
Headrush69 Posted January 18, 2023 Share Posted January 18, 2023 (edited) This is what I currently have and no window pop up and LEDBlinky controls stay lite: Quote Set oShell = CreateObject ("Wscript.Shell") Dim strArgs strArgs = "cmd /c hypseus.exe lair vldp -framefile framefile\lair.txt -fullscreen -blank_searches -min_seek_delay 1000 -bank 0 11001000 -bank 1 00100011 -seek_frames_per_ms 20 -fastboot -latency 175" oShell.Run strArgs, 0, true oShell.AppActivate("hypseus") The true argument tells the script to wait until the command run ends, so LEDBlinky remains lite. Edited June 5, 2023 by Headrush69 Added extra AppActivate for people having issues 1 Quote Link to comment Share on other sites More sharing options...
latin625 Posted January 19, 2023 Author Share Posted January 19, 2023 Thanks @headrush69 Ill give this a whirl! Quote Link to comment Share on other sites More sharing options...
MydknyteStyrm Posted June 5, 2023 Share Posted June 5, 2023 On 1/18/2023 at 6:39 PM, Headrush69 said: This is what I currently have and no window pop up and LEDBlinky controls stay lite: The true argument tells the script to wait until the command run ends, so LEDBlinky remains lite. I am having the same issue where I cant minimize the CMD window and lose focus on the emulator. Where do I put this code? In the batch file or somewhere in LB? Quote Link to comment Share on other sites More sharing options...
Headrush69 Posted June 5, 2023 Share Posted June 5, 2023 7 hours ago, MydknyteStyrm said: I am having the same issue where I cant minimize the CMD window and lose focus on the emulator. Where do I put this code? In the batch file or somewhere in LB? Is the hide command window option enabled in LB? I have these commands in a *.vbs file and call it directly from LB. not using using emulation part of LB. If you are still having issues, hypseus includes a windows subsystem version that doesn't open a command window as well. You can just rename it to hypseus,exe and try that version as well. Quote Link to comment Share on other sites More sharing options...
MydknyteStyrm Posted June 5, 2023 Share Posted June 5, 2023 3 hours ago, Headrush69 said: Is the hide command window option enabled in LB? I have these commands in a *.vbs file and call it directly from LB. not using using emulation part of LB. If you are still having issues, hypseus includes a windows subsystem version that doesn't open a command window as well. You can just rename it to hypseus,exe and try that version as well. I couldn’t find the option to Hide command window in LB. how do I implement a vbs file? is it something I run as an additional app in the emulator setting? Sorry for the handholding, I’m currently transferring over from Hyperspin (past due time lol) in the VBS file do I put the code that I currently have for my batch file in the quotations as well? Quote Link to comment Share on other sites More sharing options...
Headrush69 Posted June 5, 2023 Share Posted June 5, 2023 7 hours ago, MydknyteStyrm said: I couldn’t find the option to Hide command window in LB. Sorry I was away from computer. The Hide command window is only when using emulation mode and under the Emulator details screen. The VBS method is the same as using a BAT file. Your commands are in that file and you add that file as the launch option and turn off Use Emiulation. Here is an example of what is in my start_dlair.vbs file: Quote Set oShell = CreateObject ("Wscript.Shell") Dim strArgs strArgs = "cmd /c hypseus.exe singe vldp -framefile singe\dle\dle.txt -script singe\dle\dle.singe -fullscreen -min_seek_delay 200 -seek_frames_per_ms 20 -bezel lair.png -blend_sprites" oShell.Run strArgs, 0, false OShell.AppActivate("hypseus") Also make sure to get the windows subsystem version of Hypseus.exe. Quote Link to comment Share on other sites More sharing options...
MydknyteStyrm Posted June 6, 2023 Share Posted June 6, 2023 Got it to work beautifully. Thanks! Last question. And it’s optional. On my Singe Lightgun games, in the batch file were two other commands starting with REM. I got them from the preset batch files download. if I include them in the code, on the same line, or in a page break, but always inside the quotes, I throw an error. I haven’t tried putting them outside the quote of the argument, but wondered if you were able to implement this aS well. The game runs fine without it. It’s just a nocrosshair option. Thanks again for all your help! Quote Link to comment Share on other sites More sharing options...
Headrush69 Posted June 6, 2023 Share Posted June 6, 2023 8 hours ago, MydknyteStyrm said: Got it to work beautifully. Thanks! Last question. And it’s optional. On my Singe Lightgun games, in the batch file were two other commands starting with REM. I got them from the preset batch files download. if I include them in the code, on the same line, or in a page break, but always inside the quotes, I throw an error. I haven’t tried putting them outside the quote of the argument, but wondered if you were able to implement this aS well. The game runs fine without it. It’s just a nocrosshair option. Thanks again for all your help! Can you post the script you are trying to use? Placing them in the quotes should work. Sometimes in some editors while working, extra hidden line feeds seem to get added. In those case I delete any spaces where it wraps and re-add a space to make sure that's it's a single line. On some editors you can turn on showing invisible characters. If you can post your script and the error, that is the best bet to solving your issue. Quote Link to comment Share on other sites More sharing options...
bundangdon Posted August 6, 2023 Share Posted August 6, 2023 On 1/18/2023 at 12:26 PM, latin625 said: Solved. In case anyone needs to hide CMD but keep focus on emulator. I used hypseus.exe (The program to return to focus on) as the sample below: Set WshShell = CreateObject("WScript.Shell") Dim ObjShell :Set ObjShell = CreateObject("Wscript.Shell") WshShell.Run chr(34) & "lair.bat" & Chr(34), 0 ObjShell.AppActivate("hypseus") Thanks a lot for sharing this vbs script! It really helped me a lot with hypseus-singe, which I was setting up and (finally) got running today 1 Quote Link to comment Share on other sites More sharing options...
Cheep Posted September 27, 2023 Share Posted September 27, 2023 Just wanted to say thanks for this script-- it's way more elegant than creating shortcuts for all my Singe .bat files. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.