VBscript and Process Responding to flag a script exit?

Hey All
I work for a small game company called The Good Mood Creators and I am trying to build a software kit that can be handed to someone, and with minimal effort on their part. Copy the folder to their PC, plug in an xbox controller, click the BEGIN.*** and play
while our testing tools and streaming software have a chance to successfully start.
FYI I do not program for our game..
The tool I am including with this kit is a controller emulator (XBCE) that allows us to print controller input directly to the screen.
I am using Open Broadcasting Software to stream gameplay to a private twitch channel via a simple batch called in this vb.
My problem is that XBCE often hangs, and with some computers requires reinstalling .NET frameworks as well as the full directx distribution before updating again to get it to start. When it works however, XBCE will hang once started 1/10 times or so, then
randomly a few times in a row. I don't want the remote playtester to start recording video before the tools are started. So I wrote a script that checks to see if the program is running a short time after its been started.
<job>
<script language="VBScript">
Option Explicit
On Error GoTo 0
Dim os
Dim wmi
Dim procs
set os=CreateObject("WScript.Shell")
set wmi = GetObject ("winmgmts:")
os.CurrentDirectory = "C:\Users\Public\TESTPC-remote\"
os.run "XBCE.exe"
While True
    Set procs = wmi.ExecQuery("select * from Win32_Process Where Name = 'XBCE.exe'")
    If procs.Count > 0 Then
        Wscript.echo "Initiate Good Mood?"        
        os.run "DATA\Mekazoo.exe"
        WScript.Sleep 1000
        os.run "DATA\obsSTART.bat"
        WScript.Sleep 1000
        WScript.Quit
    Else
        WScript.Echo "Good Mood Initialization Had Failed! Please Close All Running Applications And Try Again"
        WScript.Quit
    End If
Wend
</script>
</job>
But when its hung and not responding to the task manager, the process XBCE.exe is still getting listed in Win32 Processes. The script believes all is good and initializes the stream, but XBCE wont show up on the recording because it has crashed and windows
is waiting for me to wait or close.
I have searched but to no avail have I found a way to check if the task manager thinks if XBCE is hung, then proceed to quit the script. That's all I really need. If its not hung proceed, if it's hung quit. Can someone please help?
Edit
I have updated the code above to reflect my current progress with this question and so you dont have to dig through my terrible formatting.

I have a few questions that I haven't got the vocabulary to figure out I guess.
-Is there anyway to automate changing the execution policy?
I tried sending powershell two commands from a ps1. Set-ExecutionPolicy Restricted and Set-ExecutionPolicy Unrestricted. Obviously it blocks the script from running to change from restricted. So I either needed a way through the problem or around it. I could
ask the person playtesting to Win+R powershell.exe and type Set-ExecutionPolicy to Unrestricted and then include a line in the script to change it back once everything has started. The problem with this is the user having to change the executionpolicy
every time they try to play, and the biggest reason I dont like this is that the user has to mess with powershell at all. That was my way around the problem.
My way through the problem was to find a way to bypass the execution policy. I tried running a few lines of code I picked up here in cmd as a batch file and a javascript file. The line I ran was:
http://stackoverflow.com/questions/9271681/how-to-run-powershell-script-even-if-set-executionpolicy-is-banned
powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File <C:\Users\Public\TESTPC-remote\switchrun.ps1>
Batch through cmd gave me bad syntax, JS basically said the same thing and suggested adding semicolons to fix the problems.
-What is the script syntax to start a diagnostic process and then check to see if its true?
I can not figure out how to write the script to both start XBCE as a diagnostic process and then immediately after see if its responding. I can send the command to start but powershell doesnt move to the next line.
$p=[System.Diagnostics.Process]::Start('C:\Users\Public\TESTPC-remote\XBCE.exe')
While $p.Responding = True
Invoke and start both cause powershell to stop..
-Can I use this command and chain the start commands together?
While writing the script I have now I thought about the possibility of running a program, check to see if responding equals true as a case to start the next program, or else stop the previous process and close the session. Here's my gibberish with that:
$p=[System.Diagnostics.Process]::Start('C:\Users\Public\TESTPC-remote\XBCE.exe')
While $p.Responding = True
$p=[System.Diagnostics.Process]::Start('C:\Users\Public\TESTPC-remote\Mekazoo.exe')
Else Stop-Process ('XBCE.exe')
Exit-PSSession
While $p.Responding = True
$p=[System.Diagnostics.Process]::Start('C:\Users\Public\TESTPC-remote\OBS.exe')
Else Stop-Process ('Mekazoo.exe', 'XBCE.exe')
Exit-PSSession
I have more questions but honestly with how many people have viewed my question vs answered it's clear I'm just an idiot and need to read more.. but Ill keep posting.
Youneed to drop back andlearn a bit more about how software based systems wotj and how progrmming systems work.
THe code you posted cannot funciton because it makes no technical sense.
We cannot answer every little questionfor you. You need to spend time learning the basics and ask quesitons when a real issue confuses you.
You cannot use a non-existent variable in a loop test becase it wil always evaluate to false and the loop will never execute.  This si programming 101.
Execution policy IS automated via Group Policy. Please as you domain admmisn or Netowrk Admmin to explain the to you. 
Your original question has been answered.  If you have another issue please open a new topic.
¯\_(ツ)_/¯

Similar Messages

  • TA21328 every time I use Safari I receive a message that says Safari is no longer responding because of a script problem with the website and I must press "continue" for the page to continue. This happens with every website I go to.  What is wrong with my

    When using Safari I have begun to notice this box appearing as I try to reach any website:  "Safari is no longer responding because of a script on the webpage and then it lists what ever web page I have tried to reach.  It then asks me if I want to "stop" the script or allow it to continue.  I must "continue" it in order to reach my web page/  If I press "stop" it just keeps coming back and back and I can't continue.  What is wrong with my computer or Sarari or both?

    chick --
    Does it mention "Slow Script?

  • How do I restore a backup CD of iTunes? The process keeps stalling and quits responding

    iTunes stalls operation and quits responding when I try to import iTunes backup files from a backup CD. 68 files made it before it quit restoring the rest completely.
    Also, I downloaded and installed the 64 bit version of the program, however it shows up in the Task Manager as 32 bit when I attempt to end process. I have a new 64 bit machine.
    Any help would be appreciated. I want my 1,600 tunes back. It's driving me nuts. Thanks in advance.

    There is a 64-bit installer, but the core application is still 32-bit.
    iTunes hasn't provided its own CD backup routine for a couple of years. What was used to make the backup discs? Were they verified on the source computer? Do you still have it? Are the files on an iPod or iOS device?
    tt2

  • Scripts, Packages and Process Chains

    All,
    Is the best practice to create each individual process chain for each script logic file or create one and use it for all the scripts? If I execute 2 scripts at the same time, will I encounter any locking issue?
    Let's say I have Script1.LGF and Script2.LGF to perform to different activities. If I link it using the same process chain with Run logic, will the Script2.LGF execution file if Script1.LGF executes?
    Thanks for your inputs.

    Hi,
    Yes I agree. Too many process chains would add to your maintenance. You could have once process chain and modify the dynamic script of each package you create in a such a way that they run the logic assigned to them.
    If you are running the packages that are writing the same data region, you would come across concurrency data locks.
    You could also check the usage of package links in your case, as you could group the packages to run one after another. (Example: Import the data from a flat file, Run the currency conversion and Run the lite optimizatio etc.) This is just an example, you could have your DM packages in the sequence driven by your business
    Thanks

  • SQL Server upgradation Issue : 2012 to 2014. A job step received an error at line 1 in a PowerShell script. The corresponding line is 'set-executionpolicy RemoteSigned -scope process -Force'. Correct the script and reschedule the job.

    Message
    Executed as user: CORPTST\XXXXX. A job step received an error at line 1 in a PowerShell script. The corresponding line is 'set-executionpolicy RemoteSigned -scope process -Force'. Correct the script and reschedule the job. The error information returned
    by PowerShell is: 'Security error.  '.  Process Exit Code -1.  The step failed.
    I receive this error during the sql server job 'syspolicy_purge_history' execution  when sql server got upgraded form SQL Server 2008 to 2014.

    Hi Vishnu,
    According to the error message, it also occurs in SQL Server 2012.  Here is a feedback about the error in the link below.
    https://connect.microsoft.com/SQLServer/feedback/details/754063/sql-server-2012-syspolicy-purge-history-job-step-3-fails-with-security-error
    To resolve this issue, please change the value of the following registry key from ‘RemoteSigned’ to ‘Unrestricted’. For more details, you can review this similar
    blog.
    HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps120\ExecutionPolicy
    Thanks,
    Lydia Zhang

  • Downloading 4.0 onto XP it takes a long conection process, with boxes on unresponsive script and a java scipt app saying type error and is all very annoying so what can I do I want the old firefox back a

    I downloaded Firefox 4.0 replacing an earlier Firefox version. I have XP on my computer. When I now click on the Firefox icon after a time a window saying Unresponsive script and underneath script chrome etc comes up. I then press stop script and another window comes up Java Script application and type error. Eventually I get on to the internet but it's all very frustrating. I wish I had ignored the request to download 4.0
    Please help

    I can assure you that the sympton is indeed identical. For as the computer got worse, eventually it refused to start up and made 3 beeps. It has done this before, but today more times than before (just like when it first had this problem). Where-ever you go on the internet, it will tell you that the 3 beeps suggest the RAM is at fault. So, the same 3 beeps, means the same problem, which is the RAM.
    With that in mind, I re-ask my question with the same reasoning and justification; am I still covered under warranty? (Reasoning/Justification: Considering the original problem was not entirely fixed, though something else was to make the MacBook Pro last a little longer before the reoccurance of this problem).

  • How to work with flags in scripts

    Hi all,
    I'm trying to automate the process of evaluating data in Diadem View using flags. So far I can set the flags through script commands (chnflagset) , but after that I need to change to interactive mode to replace the flagged data by NoValues (Flags: Remove data points). Is there a way to call this command from within my script so that I don't need the user interaction?
    Thanks,
    Marcel
    Solved!
    Go to Solution.

    Hi Marcel,
    I see, and now I fully understand what you're doing and why you need to automate flags and flag actions.  The functions to set and delete flags are documented, but we do not have any documented functions to fit, delete, or copy the flagged points.  These functions do exist, and are called when you interactively press the VIEW buttons.  There is a way to call them, but since it is not documented, that means that code you write today might not work in a later DIAdem version.  However, I do have code that works up to the latest version of DIAdem now available, 11.1 Beta1.  Feel free to email me at [email protected] to request these commands.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Avoid White Screen and (Not Responding) Message?

    Is there a way to force FrameMaker to update the screen when it becomes unresponsive during lengthy processes?
    I wrote an ExtendScript to open all files in a book (silently), import settings across all files, update the book, and then save as a PDF file. The script runs seven times, each time with different settings to control various things such as conditional text and variables.
    The problem is that FrameMaker churns on certain commands, such as opening all the files and importing the settings. During this time, it might take up to 10 minutes to complete the command across all files in the book. If I click off of FrameMaker onto another applicaiton, and then go back to FrameMaker I see only a FrameMaker container window with a white background. The title bar shows the book name and (Not Responding). The script is still running and everything is fine. But there is no feedback to the user to indicate what's happening.
    Is there no way to force FrameMaker to refresh the window and remove (Not Responding) from the title bar?
    Thanks,
    Jason

    Hi Jason,
    This is more of a limitation of FrameMaker's implementation of the "OWL" interface. The Not Responding title bar and white screen appear not just with scripts and FDK clients, but also with other long FrameMaker operations, like updating large books, etc. In fact, in Kapil Verma's FrameMaker 11 webinar yesterday, the same thing happened when he was creating a book from a ditamap.
    One way you can minimize the effect of this is to use a progress bar with your script, so people will know the progress of the script in spite of the white screen, etc.
    Rick Quatro

  • Why do I have to Open and physically Save a provided .xlsx File in order to source it and process it in SSIS?

    It sounds CRAZY...but it's true and I proved it out over many tests...
    We receive a .xlsx File from an outside vendor. If we simply move the file over to our processing Path and then try to source it and process it in SSIS, we get this error...
    Exception from HRESULT: 0xC02020E8
    Error at Data Flow Task [Excel Source [1]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB Error has occurred.
    Error code: 0x80004005
    However, if we open the file and Save It and/or Save As to our processing library path, we can source the .xlsx File and process it accordingly.
    Why is this? Is it because something funky is happening under the covers when the the vendor creates and saves the .xlsx File and then when we open and save it on our network it then cleans it up?
    Is there anyway that we can get around this? I hate for the processing clerk to have to go through what seems like a meaningless task....but I cannot think of any way around this if we cannot source the original file. And a C# Edit Script using Microsoft.Interpol.Excel
    is not possible because we are not allowed to put Microsoft Office on the Server where the SSIS Package will eventually reside.
    Any thoughts...suggestions...etc...would be GREATLY appreciated.
    Thanks for your review and am very hopeful (Holding my breath) for a reply and possible solution and answer to this strangeness.
    ITBobbyP85

    First of all...THANK YOU ARTHUR!
    You're probably sick and tired of seeing my posts out here on this.
    We are running Microsoft Office 32-bit which is why I downloaded the 32-bit driver of Microsoft Access Database Engine 2010 from...
    http://www.microsoft.com/en-us/download/details.aspx?id=13255
    Sooooo I think what you're saying is that it is a Microsoft Office 2010 .xlsx File but utilizing the 32-bit Microsoft Access Database Engine 2010 only allows me to source as Microsoft Excel 2007.
    Nowwww....this will run on a Server...soooo a couple of questions...
    1.) Are you saying I need to use the 64-bit Microsoft Access Database Engine 2010 in order to process this file without having to open and Save it? Can I do that if we're running Microsoft Office 32-bit? Will I be able to source this on the Server because
    we cannot install Microsoft Office 2010 on the Server where this SSIS Package will live and breathe.
    2.) How can I tell which Microsoft Access Database 2010 Engine is on the server where this will eventually reside and run? 32-bit or 64-bit?
    Welllll...maybe a 3rd question...
    3.) Is there anyway to get around this driver dependency? Can I create a script to bulkcopy it and it would simply take what's on the server.
    Now mind you...we DO NOT have Microsoft Office installed on our server where this will reside...a licensing issue...
    So maybe now this explains my struggles with this damn file(excuse my French and frustration)...and why I was using a C# Edit Script to Open and Save the File until I then deployed it to the server and the Microsoft.Office.Interop.Excel DLL was not available
    on the Server because we cannot install Microsoft Office on the Server.
    Sooooo it seems as though I'm back at square one.
    UGH!
    Any additional help you can suggest or even if we can continue this "offline" would be GREATLY GREATLY appreciated.
    Thanks!

  • Is it possible to create and process PO with the line without value?

    Hi,
    I am wondering whether is it possible to create and process the PO with the lines without the value?
    I was thinking that this process would allow me to better track and understand the pallets which arrive to the site so I have set up the pallet as a material but systems doesn't allow me to order the line (pallet) without value?
    Or maybe there is other way which will allow me to track the pallets within the system?
    Many thanks,
    Sylwia

    Dave,
    Thanks for the reply. Of all the suggestions I've received this seemed to
    be most promising. I gave it a try and the problem is that when I attempt
    to save as optimized a message box pops up and says I have to save my
    document first. Low and behold when I save it, compression occurs. Even
    when I select the options you suggest I'm left with a compressed document.
    I'm using Acrobat Pro X
    Jeff
    From:   Dave Merchant <[email protected]>
    To:     Jeff Ross <[email protected]>
    Date:   01/06/2011 09:35 AM
    Subject:        Is it possible to create and save a .PDF
    without any compression to the resulting .PDF?
    You don't want the UncompressPDF plugin - that's designed to split out the
    COS objects but doesn't remove the Flate encoding (plus if you've never
    compiled a plugin before, it's not really the time to learn).
    Instead, simply save your PDF file using the PDF (Optimized) file type,
    click the Settings button and under "Clean Up" - "Object compression
    options", choose "Remove compression". Turn everything else off if you
    want to retain the PDF content exactly as it was before.
    Your document-level scripts will then be in the file as plain text.

  • Process Flow - Executing a shell Script

    I have a simple shell script being called at the start of a process flow, up until a few days ago this worked fine across DEV, TEST and PROD.
    It's now stopped working in PROD.
    It executes through the command line fine as an os user and when you inspect:
    select * from all_rt_audit_executions where execution_name like '%SCRIPT_ONLY%' order by updated_on desc;
    The return_result is OK, but the script has not executed (it creates a simple file and I have added another one at the end of the script 'id >> whoami.txt')
    I've no idea what the sysadmin has been up to so can't comment on configuration changes on the box.
    Any ideas?
    Edited by: RodCouncil on Mar 16, 2009 4:51 PM

    First off, if the admin has upgraded or re-installed the repository, it might have reset back to the default security properties
    The properties file is found in $OWB_HOME/owb/bin/admin/Runtime.properties and change the following parameters to NATIVE_JAVA :
    property.RuntimePlatform.0.NativeExecution.FTP.security_constraint = NATIVE_JAVA
    property.RuntimePlatform.0.NativeExecution.Shell.security_constraint = NATIVE_JAVA
    property.RuntimePlatform.0.NativeExecution.SQLPlus.security_constraint = NATIVE_JAVA
    Make sure that there are no trailing spaces on the line after NATIVE_JAVA.
    Also, if they have upgraded software could they have changed the detault UNIX profie so that you are no longer finding executables? Or changed around the file structure so that your script is in a different absolute location so that OWB doesn't find it anymore? Or changed up directory permissions so that the Oracle user can't see the script anymore?
    Just a few thoughts on things to check for....
    I'd ask your sysadmin to check the OWB security profile, and then to try running the script from the Oracle Unix account and let you know the results (assuming that you do not have access to the Oracle user).
    Edited by: zeppo on Mar 16, 2009 10:40 AM

  • I get a window pop up after every click into a new site that reads : Safari is no longer responding because of a script on the webpage "    ". Do you want to stop running the script, or let it continue? If I  click on continue it just continues,

    I get a window pop up after every click into a new site that reads : Safari is no longer responding because of a script on the webpage "    ". Do you want to stop running the script, or let it continue? If I  click on continue it just continues, stop, it stops.  How to correct this annoying message?

    Disable Javascript for those webpages.  Note, your Javascript is probably antiquated by now.  Try a different web browser, or contact the website and let them know they aren't as accessible as they could be*:
    http://www.macmaps.com/browser.html

  • Read payload for error messages and throw a red flag in SXMB_MONI

    Hello All,
    I am calling a synchronous web service from PI ccBPM and getting a response back to PI ccBPM itself.
    So the steps in BPM are receive(from CRM), sync step (to call web service) and a control step (to end the BPM process).
    The requirement is to check if error_list node in the response from web service call has a value in it and throw an error in SXMB_MONI so that they can easily identify how many messages errored out  out of thousands of messages.
    This is the response structure for web service if there are errors.
    <manageResponse>
      <result>
                    <ErrorList>
                        <object>
                            <hyatt>partnerupdate--NR</hyattt>
                            <Message />
                            <Operation>jukio</Operation>
                            <User>atuser</User>
                        </object>
                     </ErrorList>
    </result>
    </manageResponse>
    Again I only need to see if error_list is not empty and throw a red flag error in SXMB_MONI.
    Thanks
    Mike

    Hi Mich,
      In Response map when Error segment appear's fail the maping so that you can see the list of message in MONI. and do not need to put any conditions in MONI.
    I mean in your Respoinse when ERROR_LIST segment coman under that one manatory field you select and take that field length say 20 characters.
    source field->Substring (0,100) get the 100 characters from source in that case case from source it won't get 100 characters mapping will fail so that you can see the Error messages in SXMB_MONI.
      Finally what I am saying do the wrong condition mapping in the response mapping so that mapping will fail.
    Regards,
    Venu.

  • What is the cost and process for factory refurbish of a tx2-1375dx with a blown system board?cc=us

    What is the cost and process for factory refurbish of a tx2-1375dx with a blown system board?
    How would one go about arranging for such service?
    Why is it impossible to contact a real human for support, either via online chat or phone? 

    Last I checked I am a real human, it is just that I do not work for HP and can't speak for them. HP would not be the place I would go for a "refurbish" job. They charge an arm and a leg for out of warranty service. You simply need to find someone to replace the system board (motherboard). It is also very likely on that model that you could have your system board repaired. There are many services on ebay that will repair the motherboard at the component level. The cost would be at or under $100 or so. I have more advice to give but many times I write a detailed response only to have the user never come back. I do check my posts so if you want more ideas just please respond. The tx2-1000 was one of the models affected by the nVidia issue that caused so many HP laptops made in the 2007-2009 era to fail prematurely. 

  • Seperate NT service for App server and Process Scheduler

    Is it possible to create a separate NT service for App server and Process Schedule for the same environment? Everytime i need to shutdown either App Domain or Prcs Domain (not both) using service, it brings down both.
    I could use psadmin but services run as a different user.
    Please advise.

    What PeopleTools release are you using?  Off the top of my head, one strategy would be to use different PS_CFG_HOMEs for the App and the Process scheduler.  The service points to the PS_CFG_HOME and reads the pswinsrv.cfg file to know what to start/stop.  I'm not sure there is a way to override psntsrv and tell it to use a different config file, so you may need a different HOME.  You could also create a script that wraps the service start/stop.  It could edit/update the config file prior to stop/start and remove Process Scheduler from the config and then reinsert it later.
    You could have a stop_app/start_app and stop_prcs/start_prcs script that would copy in specific versions of the pswinsrv.cfg file for what you want to do.

Maybe you are looking for

  • 10.4.3 with VPC problems

    Not sure where to post this but here goes... I've used VPC for years. Started having problems with it after I installed Tiger so I decided to upgrade it to the latest 7.0.2. One of the problems I was having still persists and I have a new one. 1. In

  • Off scale data in a graph

    Numbers documentation states that when plotting data that the Y axis must include every data point. This makes it impossible to plot a graph that has a small portion of irrelevant data that is off scale while the relative data is on scale. Does anyon

  • OracleXMLStaticSave does not exist

    One of our developers says they get this message when trying to import an XML file into our 9.2.0.6 database. Application Express was installed (or so we thought) on this server by a now-departed DBA. What steps should we take to review the installat

  • The question about from datasource to PSA

    hi,experts,I have one question .the data selection of datapackage is blank.That means all of data have been selected.but I found that some data didn't enter PSA.so,I wonder why not all data enter PSA. thanks. Best Regards. Brian.

  • Solaris 9 and V490's

    I am attempting to jumpstart Solaris 9 9/04 patch level Generic_118558-28 onto a brand new V490 that uses the 1.5Ghz USIV+ processor. The OBP level is 4.18.1. I am getting the error: krtld: load_exec: fail to expand cpu/$CPU krtld: error during initi