none
Two tasks in one script RRS feed

  • Question

  • Sorry, I'm a nooby. 

    Dim objShell
    Set objShell = WScript.CreateObject( "WScript.Shell" )
    WScript.Sleep 10000
    objShell.Run ("c:\temp\devcon enable @SCSI\DISK&VEN_WDC&PROD_WD10EZEX-08WN4A0\4&39693902&0&030000")
    Set objShell = WScript.CreateObject( "WScript.Shell" )
    WScript.Sleep 10000
    objShell.Run ("c:\temp\devcon enable @SCSI\DISK&VEN_WDC&PROD_WD10EZEX-08WN4A0\4&39693902&0&040000")
    Set objShell = Nothing

    This will only run the first devcon command. Any idea how I can make it run both commands?

    Thanks.

    • Moved by Bill_Stewart Monday, April 30, 2018 9:23 PM Unanswerable drive-by question
    Friday, February 23, 2018 2:46 AM

All replies

  • If you are going to use any reasonably sophisticated technology you first must learn that technology.  Don't just blindly copy things without understanding them.  Monkeys mastered that thousands of years ago.  Apparently techies haven't caught up to our co-species.

    Set objShell = WScript.CreateObject( "WScript.Shell" )
    
    objShell.Run "c:\temp\devcon enable @SCSI\DISK&VEN_WDC&PROD_WD10EZEX-08WN4A0\4&39693902&0&030000",True
    objShell.Run "c:\temp\devcon enable @SCSI\DISK&VEN_WDC&PROD_WD10EZEX-08WN4A0\4&39693902&0&040000",True
    

    Don't copy - learn.  Use PowerShell

    PowerShell:

    c:\temp\devcon enable "@SCSI\DISK&VEN_WDC&PROD_WD10EZEX-08WN4A0\4&39693902&0&030000"
    c:\temp\devcon enable "@SCSI\DISK&VEN_WDC&PROD_WD10EZEX-08WN4A0\4&39693902&0&040000"
    


    \_(ツ)_/

    Friday, February 23, 2018 3:12 AM