Announcement

Collapse
No announcement yet.

I would like to merge these into 1 file

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • I would like to merge these into 1 file

    Hello,

    I got 2 scripts that I would like to merge into a single file, here they are and what they do:


    invisible.vbs
    ---------------------
    Set WshShell = CreateObject("WScript.Shell")
    cmds=WshShell.RUN("c:\1\test2.cmd", 0, True)
    Set WshShell = Nothing
    ---------------------
    >> This script makes the next script invisible (I don't want to see the CMD box)


    test2.cmd
    ---------------------
    @echo off
    cd \
    cd %ApplicationRoot%\bin
    cmd /C app.exe -trace
    goto exit

    :exit
    logoff
    ---------------------
    >> This script runs my application (It has to run from the specific folder (%ApplicationRoot%\bin) because the working directory is very important, also, it logoff automatically when the user closes the application.

    You probably look at these and laugh, you are right because I have no idea what I am doing

    I would like to merge this into a single if possible, or any suggestions at all are VERY welcome.

    Thank you very much,
    Toast
    Last edited by toastman; 27th January 2010, 21:13.

  • #2
    Re: I would like to merge these into 1 file

    Here you go:
    Code:
    Dim WshShell
    Set WshShell = CreateObject("Wscript.Shell")
    
    workingdir = "w:\orking\directory"
    inhouseapp = "app.exe"
    appswitches = "-trace"
    
    cmdln = "pushD """ & workingdir & """ &&start """"/w" _
             & " """ & inhouseapp & """ " & appswitches
    
    Returncode = WshShell.RUN("cmd /c " & cmdln, 0, True)
    
    'end
    beeps = WshShell.RUN("cmd /c echo\&echo\", 0, False)
    Returncode = WshShell.RUN("logoff.exe", 0, False)
    \Rems

    This posting is provided "AS IS" with no warranties, and confers no rights.

    __________________

    ** Remember to give credit where credit's due **
    and leave Reputation Points for meaningful posts

    Comment

    Working...
    X