Jump to content
Sign in to follow this  
Guest Guest_TimBs

Problems with Dos commands

Recommended Posts

Guest Guest_TimBs


I'm trying to display results from a Doc command to a window eg Net View. I'm using the following code which I found on your site



controlsend(@comspec,"","","Net view{enter}")


controlsend(@comspec,"","","!{space}es{enter}") --- not sure what this is doing



Problem are:

1. I want to hide the Dos window but don't seem to be able to get a result if I use @SW_HIDE in the first line

ie Run(@comspec,"",@SW_HIDE)

2. This code works on a Win 2000 box but not NT

Can anyone help please

Share this post

Link to post
Share on other sites

;Stock standard AU3
    $sResultsFile = "C:\results.txt"
    RunWait(@comspec & " /c net view >" & $sResultsFile,"",@SW_HIDE)   
    $sResults = FileRead($sResultsFile, FileGetSize($sResultsFile))
    Msgbox(4096 + 48,"net view >" & $sResultsFile,$sResults)

;Alternative using CB
    RunWait(@comspec & " /c net view|cb","",@SW_HIDE)   
    $sResults = ClipGet()
    Msgbox(4096 + 48,"net view|cb",$sResults)

For CB.EXE add-on utility, see here in the Scripts And Scraps Forum


Share this post

Link to post
Share on other sites
Guest Guest_TimBS

Hi, Thanks for that --- it's brilliant, just what I wanted

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.