Attract-Mode Support Forum

Attract-Mode Support => General => Topic started by: albert_c on February 14, 2018, 07:50:15 PM

Title: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: albert_c on February 14, 2018, 07:50:15 PM
I have InstantSheller working to shell to a batch file to launch Attract Mode as instructed here (http://forum.attractmode.org/index.php?topic=47.0). Want to take this a step further and hide the launching of the batch file which is visible just before AM loads. This is cosmetic but makes a difference with presentation in a cab build.

Been reading about how to achieve this for other applications and have been unsuccessful. What is mentioned is to edit the batch file to run it minimized. Or the other way is to use a VBS script to launch the batch file; thus the batch file shall be hidden by the VBS script. I have been unsuccessul in applying either method. I really know nothing about scripting other than following the work layed down by others and copy/pasting. Any help would be appreciated. Thanks!
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: hermine.potter on February 14, 2018, 10:20:23 PM
@albert_c
there is a bat to exe converter (https://www.majorgeeks.com/files/details/bat_to_exe_converter.html). you can compile your script as an invisible exe.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: albert_c on February 14, 2018, 11:43:39 PM
Interesting. I'll give it a shot and update this thread.

One more question before I get to that however; is there a definitive guide for cab building (15kkhz/CGA/Arcade Monitor-type) located anywhere on this site or Youtube? I have lots of expertise in this area and wouldn't mind contributing in that manner. But don't want to duplicate efforts either.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: hermine.potter on February 15, 2018, 12:06:19 AM
@albert_c
community is asking questions and answers to AM frontend, because this is the main focus ^-^
somebody started here (http://forum.attractmode.org/index.php?topic=339.0) a thread.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: albert_c on February 15, 2018, 12:40:41 AM
Alright. I'll put a video series together on Youtube then. Won't link to it here. But will give a shout out to Attract Mode appropriately.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: hermine.potter on February 15, 2018, 01:08:26 AM
@albert_c
it's an exiting topic an i have some ideas too.
an section emulators already exists.
maybe an admin or mod could create a new section for cab building?!
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: albert_c on February 15, 2018, 02:52:54 AM
@albert_c
it's an exiting topic an i have some ideas too.
an section emulators already exists.
maybe an admin or mod could create a new section for cab building?!

I am up for contributing to such a sub-forum. I started out with MAME emulation and HyperSpin, then graduated to arcade collecting. I now have over 20 CRT-based arcade cabs. Wouldn't mind contributing to give back to this community.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: keilmillerjr on February 15, 2018, 03:45:11 AM
Why not just set attract as shell in registry?
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: albert_c on February 15, 2018, 12:10:17 PM
Why not just set attract as shell in registry?

Shelling directly to "attract.exe" (or using InstantSheller to do that) creates a weird conflict where it seems Attract Mode is launched with the settings menu open.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: keilmillerjr on February 15, 2018, 05:36:23 PM
Why not just set attract as shell in registry?

Shelling directly to "attract.exe" (or using InstantSheller to do that) creates a weird conflict where it seems Attract Mode is launched with the settings menu open.

Code: [Select]
Keils-iMac:~ keiljr$ /Applications/Attract.app/Contents/MacOS/attract -c /Users/keiljr/.attract
Edit paths as appropriate for your windows install. Problem solved.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: albert_c on February 15, 2018, 08:05:45 PM

Code: [Select]
Keils-iMac:~ keiljr$ /Applications/Attract.app/Contents/MacOS/attract -c /Users/keiljr/.attract
Edit paths as appropriate for your windows install. Problem solved.

that code you posted is for MacOS. Am I missing something here? What is the corresponding action or change needed for Windows 7? Also, instantSheller does things such as hides parts of Windows which improves the presentation. Allows for boot logos. Sort of makes the presentation better. InstantSheller is not really avoidable for a cab build.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: albert_c on February 16, 2018, 04:46:47 AM
Ahh, k. I see. So for my install, I have to change the shell in regedit to:

"C:\Attract Mode\attract.exe -c C:\Attract Mode"

I'll give this a shot and see what happens.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: keilmillerjr on February 16, 2018, 06:08:12 AM
Ahh, k. I see. So for my install, I have to change the shell in regedit to:

"C:\Attract Mode\attract.exe -c C:\Attract Mode"

I'll give this a shot and see what happens.

That’s right. ^^^^

Everything done in instasheller can be done without. Instasheller is no longer maintained so it doesn’t work on newer windows versions. I have win 10 100% hidden without instasheller. Legit 100%.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: albert_c on February 16, 2018, 11:18:11 AM
Hmm, changing the shell key in regedit isn't working :/. I'll give the bat-to-exe thing a shot.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: albert_c on February 16, 2018, 04:10:13 PM
Burrrr, so I did get it to work as desired with the BAT-to-EXE converter posted earlier by @hermine.potter. Now the command console does not appear just before AM loads. AM launches fine. I checked to make sure that focus wasn't stolen after launching a few games. Seems to be all good and accomplishes what I set out to do. Should be noted that I can set InstantSheller to shell to the exe I created, or works by making the registry change manually.

But but but but, adding in this entry to the registry didn't work for me at all:

C:\Attract Mode\attract.exe -c C:\Attract Mode

Wasn't from a lack of trying either. Trying from normal Windows Explorer after undoing changes from InstantSheller didn't work. Tried it without the 'C:\Attract Mode' suffix at the end of the entry, and with it. With the backslash at the end and without it. With quotations, without them. Made the changes after using InstantSheller and bringing up regedit. Typed in the entry precisely, copied the directory and exe file name from the properties menu and explorer bar even. Nothing worked with this entry. Not very fun doing this on a CGA 15khz arcade monitor, I might add.

Perhaps my installation of Windows for this build has been flumoxed with enough where this would not work any longer. So I'll save investigating getting shelling to work using that registry entry for the next build which will be sometime next week.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: keilmillerjr on February 16, 2018, 07:48:09 PM
The command I posted does work. It points attract to the config directory. It does not hide the console like you think? I’m so confused now as to what you are trying to do and have already done.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: albert_c on February 16, 2018, 08:20:42 PM
The command I posted does work. It points attract to the config directory. It does not hide the console like you think? I’m so confused now as to what you are trying to do and have already done.

I am just trying to shell directly to AM properly. I achieved it by shelling to the batch file, but that leaves the batch file command window visible. I want to get rid of that. Just straight shell to AM.

I am sure that command works, it just doesn't work on this build I am working on. What's happening now is that Attract Mode doesn't even launch upon bootup entering that command from the registry. I'll pass on figuring it out for now as the BATCH-to-EXE work-around works. And so look towards the next build using that command and report back.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: keilmillerjr on February 17, 2018, 10:39:01 AM
The command I posted does work. It points attract to the config directory. It does not hide the console like you think? I’m so confused now as to what you are trying to do and have already done.

I am just trying to shell directly to AM properly. I achieved it by shelling to the batch file, but that leaves the batch file command window visible. I want to get rid of that. Just straight shell to AM.

I am sure that command works, it just doesn't work on this build I am working on. What's happening now is that Attract Mode doesn't even launch upon bootup entering that command from the registry. I'll pass on figuring it out for now as the BATCH-to-EXE work-around works. And so look towards the next build using that command and report back.

What build are you using?

You shouldn’t need to use a batch file. I’ve been shelling attract from registry for a few years now. The -c param will resolve config issues in most cases. Attract 2.1 has two separate builds, with and without command line. I also have an ahk script/app I made to hide the attract console and pass params. Can find it in the plug-ins sticky. Obsolete now.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: albert_c on February 17, 2018, 12:48:37 PM
I am using AM ver 2.3. Also, I can confirm that command works!

Interestingly enough, I bricked my HDD and had to reinstall everything last night. After everything was back up and running, I tried the command and it worked perfectly. I haven't run all the Windows updates on the restore. I have only installed the roll-up update pack and essential files (.Net, Visual C++, drivers). Perhaps Windows Updates is causing some conflict. But it works now without any work-arounds. Thanks!
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: YellowBirdAZ on February 20, 2018, 06:05:50 AM
Another possible solution... this works on Win 10 and I imagine Win 7 as well.

I have one AHK script that launches everything I need to have running at startup: it starts up my control panel (I-PAC 4) with the appropriate profile, it sets 320x240 resolution for CRT and defines hotkeys to switch resolutions (mostly for troubleshooting), and it launches Attract Mode itself. (I run the non-console version 2.3.)

The script is compiled as an EXE, and I put it in the registry instead of explorer.exe. So on start-up this script runs instead of Windows explorer, and in turn it launches Attract Mode.

It works pretty well. You see the Win 10 load screen briefly, then it just jumps straight into my intro.nut. Also, it seems like it helps with issues of quitting games and returning to Attract Mode with the front end in proper focus.

I use a lot of Autohotkey scripts on my cabinet to manage resolution changes for non-MAME games and various other tasks. I also use it to assign functions to certain buttons, like if you hold pause for 3 seconds I have AHK treat it as a quit game input (so I only need one physical button for pause and quit). It is also handy for dealing with configuration popups for games like Slain, where it asks you to choose your preferred resolution every time you start the game up. AHK can hide those and make the appropriate selection without the user ever seeing them. Anyhow, I highly recommend it, especially if you are mixing MAME and non-MAME content.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: albert_c on February 24, 2018, 02:40:31 PM
keilmillerjr, hermine.potter, YellowBirdAZ, All,

I figured it out why on some installs/cab builds using the <directory\attract.exe> -c <directory> command does not always work. It is pretty simple. If there is a space in the directory name, the command fails. In one of my builds, the directory was 'c:\Attract Mode', with a space between 'Attract' and 'Mode'. In another build, it was just 'c:\AttractMode', with no space.

Flipped the builds back and forth removing the space in the directory name and then updating the shell command. Like clock work, it would fail with the space in the directory name, then work without the space in the directory name.

Give it a shot and see if you an replicate it.
Title: Re: InstantSheller in Win7 - Need to Hide Batch Command Prompt
Post by: hermine.potter on February 26, 2018, 01:47:29 AM
@albert_c
this is a know problem with command line execution & spaces in path and filenames.
you have to use quotation marks ( " )
Code: [Select]
"C:\attract mode\attract.exe" -c "C:\attract mode"
(http://fs1.directupload.net/images/180226/cz7zsryu.gif)

Instant Sheller Thread updated (http://forum.attractmode.org/index.php?topic=47.0)