Jump to content

something with syntax?


 Share

Recommended Posts

Try this and see what the cmd prompt says (if it has any errors of its own):

Use Run instead of RunWait, use /k instead of /c (keep the cmd window open), and change @SW_HIDE to @SW_SHOW.

[ EDIT ]

Another good idea would be to break it down into a few lines, because that is definitely confusing as is.

$DevconExe = @ScriptDir & "\devcon.exe"

$SendTxt = @ScriptDir & "\send.txt"

...

[ /EDIT ]

Edited by greenmachine
Link to comment
Share on other sites

For one, it's easier to read if you use the same quote type for all text. Use only single OR double quotes. Also, there's no need to close the quote just to append a quote, as in "some text " & '"' & @something. Just use 'some text "' & @something.

Next, is "find *" supposed to be a parameter for devcon.exe or do you mean to pipe devcon.exe's output to the find command, as in:

RunWait (@ComSpec & ' /c "' & @ScriptDir & '\devcon.exe" | find * > "' & @ScriptDir & '\send.txt"',@WindowsDir,@SW_HIDE)

*EDIT* Typo

Edited by c0deWorm

My UDFs: ExitCodes

Link to comment
Share on other sites

This code here works

Run("cmd")
WinWaitActive("C:\WINDOWS\system32\")
Send('"' & @ScriptDir & '\devcon.exe"' & " find * > " & '"' & @ScriptDir & "\send.txt" & '"')
Send("{Enter}")
If I used that code, it wouldn't work for me. No window called "C:\WINDOWS\system32\" ever shows up for me when I open the command prompt. Mine's just called "Command Prompt". I would use ProcessWait("cmd.exe") instead of WinWaitActive("C:\WINDOWS\system32\"), just in case the title is different.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...