Forum Discussion
lightwell
11 years agoHonored Guest
Issues with auto-launching direct-to-rift Unity build
Hello, I've created an application for the DK2 using Unity 4.5.2, and I need to be able to keep the application running (if it crashes, it needs to be supervised and brought back up automatically)....
lightwell
11 years agoHonored Guest
Thanks.
I managed to scrounge up a Visual Basic script that successfully reopens an application if it's not already open, and paired it up with the Task Scheduler so it runs the script every 5 minutes.
However, since I have no experience with Visual Basic, I'm not sure how to integrate the setCurrentDirectory line into this. I sat down for a few hours and tried to work it out with a lot of research, but kept getting errors that I couldn't resolve. Probably just need more time to learn the syntax.
I'm not expecting the answer to just be handed to me since it would be good to learn this, but it would be great if you could give a little more guidance about how to go about it - I appreciate it.
This is the .vbs script I'm using:
I managed to scrounge up a Visual Basic script that successfully reopens an application if it's not already open, and paired it up with the Task Scheduler so it runs the script every 5 minutes.
However, since I have no experience with Visual Basic, I'm not sure how to integrate the setCurrentDirectory line into this. I sat down for a few hours and tried to work it out with a lot of research, but kept getting errors that I couldn't resolve. Probably just need more time to learn the syntax.
I'm not expecting the answer to just be handed to me since it would be good to learn this, but it would be great if you could give a little more guidance about how to go about it - I appreciate it.
This is the .vbs script I'm using:
blnRunningProgramFound = False
For Each process In GetObject("winmgmts:").InstancesOf _
("win32_process")
If process.Name = "SIMS_Development_Windows_2.7b_DirectToRift.exe" Then
' Program found
blnRunningProgramFound = True
End If
Next
If blnRunningProgramFound = False Then
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "C:\Users\Michael\Desktop\SIMSOculus\SIMS_Development_Windows_2.7b_DirectToRift.exe"
End If
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 1 year ago
- 1 month ago