Build Your Own Arcade Controls Forum

Main => Software Forum => Topic started by: TopJimmyCooks on February 13, 2012, 01:08:14 pm

Title: Help requested from Nitz or other script masters
Post by: TopJimmyCooks on February 13, 2012, 01:08:14 pm
I have a bat file to rotate my monitor to horizontal if I exit mala in vertical orientation:

Code: [Select]
@echo off
smccmd --speed -1500

It works but shows a brief flash of a cmd window.  How can I change this so that cmd doesn't show at all?

Also, I wonder if I can do something AHK wise to help with this other problem http://forum.arcadecontrols.com/index.php?topic=115904.0 (http://forum.arcadecontrols.com/index.php?topic=115904.0)?  Thanks.
Title: Re: Help requested from Nitz or other script masters
Post by: Le Chuck on February 13, 2012, 01:20:37 pm
With this, same thing I used to fix the focus stealing bat in my Tron Switch

Code: [Select]
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\arcade\tronswitch\4way.bat" & Chr(34), 0
Set WshShell = Nothing


All you should need to change is stuff in "" and then have MALA point at this rather than your bat.

You save it as a .vbs

As for the sound issue, that's out of my depth.

Let me know if that solves you issue.  
Title: Re: Help requested from Nitz or other script masters
Post by: TopJimmyCooks on February 13, 2012, 01:26:41 pm
I saw that in your thread but was afraid to jump on it because I'm not familiar with WshShell or the .vbs extension.  (visual basic?)  You mean change "C:\arcade . . ." to my bat file and directory but leave "WScript.Shell" as is, right?  I'll give it a try.
Title: Re: Help requested from Nitz or other script masters
Post by: Howard_Casto on February 13, 2012, 01:27:40 pm
Ok I'm not familair with mala's settings that much so this may be a dumb question... but why are you using a batch file anyway?  Why not run the program directly?  If it has the option to launch a bat then it should have the option to run a exe with command line options right?

Title: Re: Help requested from Nitz or other script masters
Post by: Le Chuck on February 13, 2012, 01:37:13 pm
Howard, I'll need to check if you can enter it in directly like that.  For some reason I think that you have to point it at an exe or bat but that it doesn't have a way to add in the command line options.  Hrmm.  I know that when I made my AHK script I was having trouble getting it to call USCCMD directly so I did this work-around.  That, I am sure, is because I am a crappy coder rather than it being impossible to do.    

Jimmy, I pulled that thing right off of google because i was having a similar issue.  Sorry that I was unclear, just change the bat file location "C:\arcade..." and leave everything else the same.  I need to go home and look at the script because I can't remember if you leave the "" around it or not.  I would normally say no but can't recall.  Too easy to try it both ways.  I had to get down next to my servo and listen for the clicks to tell if it was working the first time I ran it because I thought nothing happened.  Nice little script.  
Title: Re: Help requested from Nitz or other script masters
Post by: TopJimmyCooks on February 13, 2012, 02:08:41 pm
Howard, this comes up because MaLa can run an exe or bat upon closing.  When the normal rotation's happening in Mala during operation, I do have DaOldMan's startcom program just doing the command line stuff for the pololu SMC program without a bat involved.

Edit:
I tried to put the command line smccmd call with and without location in the "run when Mala exits" box, and it didn't work.  jive's with my memory from last summer setting up the rotation.  Not everything will work in that box.  bats yes, bat converted to exe, no, and now .vbs, yes.  smccmd is installed as a service and should run regardless of location, etc.

Chuck: I used your .vbs to call the bat and it worked silently.  Thanks.
Title: Re: Help requested from Nitz or other script masters
Post by: nitz on February 13, 2012, 09:48:32 pm
What??? I heard my name! Oh, you've got it fixed...nevermind then. ;D

I am gonna post in your other thread though about the Mala issue. ;)
Title: Re: Help requested from Nitz or other script masters
Post by: Le Chuck on February 14, 2012, 03:39:21 am

Chuck: I used your .vbs to call the bat and it worked silently.  Thanks.

 :cheers: one is glad to be of service.