1
votes

I started using today a program named "oblytile", which gives you the ability to add custom tiles to Metro UI in Windows 8/8.1. The program works fine, but I have one big issue when I open created tile to folder, program, file etc. for a short time a small black window (like CMD) pops up, like here:

http://i.imgur.com/ZDYBxBc.png

and after the window disappears the program I wanted opens. I have watched some YouTube videos and other people didn't have something like this. I checked folder in which one program stores data about tiles and I found out that evry time I click on custom tile in Metro UI a VBScript is started.

Sample tile VBScript:

On Error Resume Next
Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strApp = "C:\Users\bluea_000\OneDrive"

arrPath = Split(strApp, "\")

For i = 0 to Ubound(arrPath) - 1
    strAppPath = strAppPath & arrPath(i) & "\"
Next 

objShell.CurrentDirectory = strAppPath
objShell.Run """C:\Users\bluea_000\OneDrive""" & ""
If Err.Number <> 0 Then
    If InStr(1, strApp, "/") > 0 then
    Else
        If InStr(1, strApp, "www.") > 0 then
        Else
            If InStr(1, strApp, "shell:") > 0 then
            Else
                If objFSO.folderExists(strApp) Then
                Else
                    If objFSO.FileExists(strApp) Then
                    Else
                        MsgBox strApp & " not found", 16, "OblyTile"
                    End If
                End If
            End If
        End If
    End If
    Err.Clear
End If

Can anyone tell me how to hide this black window or fix it?

I asked on forum where the program was published, but probably the project has been abandoned and noone will answer me.

1

1 Answers

0
votes

There are two interpreters for vbs files. Wscript and cscript.

Cscript is the command-line based scripting host and, thus, opens the black console window, wscript is the windows based scripting host and doesn't open a command-line window.

Use wscript for executing your script and no black window will pop up.

See https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/wsh_runfromwindowsbasedhost.mspx