Need to find a way to hide the fact that I am shelling to devcon

Author Message
ZiggyStardust

  • Total Posts : 7
  • Scores: 0
  • Reward points : 0
  • Joined: 12/24/2011
  • Status: offline
Need to find a way to hide the fact that I am shelling to devcon Sunday, December 25, 2011 7:59 AM (permalink)
0
   I have a VB script that shells to devcon. It is annyoing. Every time it shells to devcon you actually see the dos like devcon screen pop up. The title on that windows says it is running devcon and you see the results. Is there any way to shell to devcon and not have it display anything n the screen?
 
#1
    Hackoo

    • Total Posts : 105
    • Scores: 4
    • Reward points : 0
    • Joined: 6/25/2010
    • Status: offline
    Re:Need to find a way to hide the fact that I am shelling to devcon Sunday, December 25, 2011 10:01 PM (permalink)
    0
    ZiggyStardust

    I have a VB script that shells to devcon. It is annyoing. Every time it shells to devcon you actually see the dos like devcon screen pop up. The title on that windows says it is running devcon and you see the results. Is there any way to shell to devcon and not have it display anything n the screen?

    Hi !
    Would you Please Post your code here
    Thanks !
     
    #2
      ZiggyStardust

      • Total Posts : 7
      • Scores: 0
      • Reward points : 0
      • Joined: 12/24/2011
      • Status: offline
      Re:Need to find a way to hide the fact that I am shelling to devcon Monday, December 26, 2011 1:16 AM (permalink)
      0
      WShell.Exec "devcon enable @ROOT\IMAGE\0000"
       
      #3
        ehvbs

        • Total Posts : 3320
        • Scores: 110
        • Reward points : 0
        • Joined: 6/22/2005
        • Location: Germany
        • Status: offline
        Re:Need to find a way to hide the fact that I am shelling to devcon Monday, December 26, 2011 3:29 AM (permalink)
        0
        Use .Run (read the Docs, tearn about all parameters) instead.
         
        #4
          ZiggyStardust

          • Total Posts : 7
          • Scores: 0
          • Reward points : 0
          • Joined: 12/24/2011
          • Status: offline
          Re:Need to find a way to hide the fact that I am shelling to devcon Monday, December 26, 2011 5:49 AM (permalink)
          0
          I changed it to .run and tried to find a good description of the parameters buth didn't have much luck. Here is the new line:
           
          Results = WShell.Run("devcon enable @HID\VID_04E7&PID_0050\6&3549263F&0&0000",0,1)
           
          You can still see the devcon window come up just as before. If you know the parameters not to have the devcon windows show up at all would you mind telling me what they are?
           
          #5
            Hackoo

            • Total Posts : 105
            • Scores: 4
            • Reward points : 0
            • Joined: 6/25/2010
            • Status: offline
            Re:Need to find a way to hide the fact that I am shelling to devcon Monday, December 26, 2011 7:35 AM (permalink)
            0
            WshShell.Run

            Run an external Command.

            Syntax
            WshShell.Run (strCommand, [intWindowStyle], [bWaitOnReturn])

            Parameters

            strCommand  :  The Command to be executed

            intWindowStyle
            (Optional)  :  Int value indicating the appearance of
            the program's window.
            Not all programs make use of this.

            bWaitOnReturn : Wait for the command to complete before
            continuing execution of the wsh script.

            If bWaitOnReturn is set to TRUE, the Run method returns any error code returned by the application.

            If bWaitOnReturn is not specified or FALSE, this method immediately returns to script execution rather than waiting on the process termination (and returns an error code of 0)

            Specifying the bWaitOnReturn parameter allows you to run programs synchronously (one at a time).

            Environment variables within the argument strCommand are automatically expanded.

            If a file type has been properly registered to a particular program, calling run on a file of that type executes the program. For example, if Word is installed on your computer system, calling Run on a *.doc file starts Word, and loads the document.

            Settings for intWindowStyle:

            0 Hide the window and activate another window.
            1 Activate and display the window. (restore size and position) Specify this flag when displaying a window for the first time.
            2 Activate & minimize.
            3 Activate & maximize.
            4 Restore. The active window remains active.
            5 Activate & Restore.
            6 Minimize & activate the next top-level window in the Z order.
            7 Minimize. The active window remains active.
            8 Display the window in its current state. The active window remains active.
            9 Restore & Activate. Specify this flag when restoring a minimized window.
            10 Sets the show-state based on the state of the program that started the application.

            Examples

            ' Launch Notepad with the current executed script:

            Set WshShell = WScript.CreateObject("WScript.Shell")
            WshShell.Run ("%windir%\notepad" & WScript.ScriptFullName)


            ' Launch Notepad with the current executed script, specify the
            ' window type, wait for Notepad to be shut down by the user,
            ' and save the error code returned from Notepad when it exits:

            Set WshShell = WScript.CreateObject("WScript.Shell")
            Return = WshShell.Run("notepad " & WScript.ScriptFullName, 1, true)


            'Open a cmd window, change the path to C:\ , and execute the DIR command:

            Dim objShell
            Set objShell = WScript.CreateObject ("WScript.shell")
            objShell.run "cmd /K CD C:\ & Dir"
            Set objShell = Nothing

            Call one VB script from another. This can be done as shown below, although it is usually better to put everything in a single script and use Functions to split up the blocks of code.

            Set objShell = CreateObject("WScript.Shell")
            objShell.run("cscript C:\scripts\demo.vbs")
            <message edited by Hackoo on Monday, December 26, 2011 7:41 AM>
             
            #6
              Hackoo

              • Total Posts : 105
              • Scores: 4
              • Reward points : 0
              • Joined: 6/25/2010
              • Status: offline
              Re:Need to find a way to hide the fact that I am shelling to devcon Monday, December 26, 2011 7:54 AM (permalink)
              3
              Fisrt of all if your "devcon.exe" dosn't exists in your system32 Folder you must copy it there or you must indicated the absolute path of your external program For your example should be like this if the "devcone.exe" is in the system32 :

              Set WshShell = CreateObject("WScript.Shell")
              strCommand = "Cmd /C devcon enable @HID\VID_04E7&PID_0050\6&3549263F&0&0000"
              Result = WshShell.Run(strCommand,0,True)
               
              #7
                ZiggyStardust

                • Total Posts : 7
                • Scores: 0
                • Reward points : 0
                • Joined: 12/24/2011
                • Status: offline
                Re:Need to find a way to hide the fact that I am shelling to devcon Monday, December 26, 2011 8:42 AM (permalink)
                0
                Worked like a dream. Thanks Hackoo!
                 
                #8

                  Online Bookmarks Sharing: Share/Bookmark

                  Jump to:

                  Current active users

                  There are 0 members and 1 guests.

                  Icon Legend and Permission

                  • New Messages
                  • No New Messages
                  • Hot Topic w/ New Messages
                  • Hot Topic w/o New Messages
                  • Locked w/ New Messages
                  • Locked w/o New Messages
                  • Read Message
                  • Post New Thread
                  • Reply to message
                  • Post New Poll
                  • Submit Vote
                  • Post reward post
                  • Delete my own posts
                  • Delete my own threads
                  • Rate post

                  2000-2012 ASPPlayground.NET Forum Version 3.9