Jump to content

momitty

Active Members
  • Posts

    66
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

momitty's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Nevermind... that worked one or two times. Quit working again.
  2. Oh jeez.... you know what fixed this? Just not using the @comspec to call the psexec command. I just called psexec directly in the Run command and all is well. I wonder if it has something to do with passing a command that's passing a command to a command (that just reminded me of Tropic Thunder I'm just a dude playing a dude) $iPID = Run("PsExec.exe ""\\192.168.0.5"" sc query type= service state= all", "") ProcessWaitClose($iPID) $stdOut = StdoutRead($iPID)
  3. I know you can run sc remote too. What I was saying in my earlier explanation is I found is it runs a lot lot slower when you run the sc command remote versus using psexec to run it remote and capture the output from there (except obviously the output isn't getting fully captured in AutoIt). Some of it is due to a firewall issue but even without a firewall running sc to a remote PC takes several seconds but PsExec running sc gets me the output in basically the same time as running it local. If I have to just call a batch file and redirect that to an output file and then parse that output file that it creates I can probably live with that. It's just so weird it can get some of the stdout but not the whole thing.
  4. It works fine locally, and it works fine if I run this manually from a command prompt but as soon as I put it inside AutoIt it dumps out. The other weird thing is if I put this in a batch file and try to capture the stdout from the batch file it still gives me the single line but if I redirect stdout to a file it all makes it into the file. That's what led me to think it's AutoIt stopping on some sort of embedded character that occurs after each of the service sections. Here's the command I run from the command line (works): c:\pstools\psexec -accepteula \\192.168.0.5 sc query type= service state= all Here's the command in AutoIt (runs but only shows one service) Run(@ComSpec & " /C c:\pstools\psexec \\192.168.0.5 sc query type= service state= all", @SW_HIDE, 0x8) (I've tried all the different flags to see if it's losing something in stderr or something)
  5. So the specific command I am running with psexec is the sc command. The reason I'm doing it with psexec is because using sc or using psservice on a remote computer actually returns the results a lot slower! That aside, when you run the command it has multiple "blocks" of output, one for each service. Like so... SERVICE_NAME: axinstsv TYPE : 20 WIN32_SHARE_PROCESS STATE : 1 STOPPED WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 Normally if you run the command sc query type= service state= all you would get probably about 100-200 services (how many ever services you have on your computer). But when you run it through AutoIt you will only ever get one (runs just fine at a command prompt). Now to make things even stranger, when I run that same command but with a findstr like so.... sc query type= service state= all|findstr SERVICE_NAME it only returns one line. So it's not the length of the string, I'm wondering if there is some hidden character in there it dumps out on?
  6. This is a very old thread, but did anybody ever solve this? I'm having the exact same problem! Truncates PSEXEC output in the same spot every time.
  7. Does anybody have any idea on this? I found a utility called Jumplist Extender that did exactly what I wanted....only problem is you had to leave it running at all times. That doesn't make my GUI very portable. I'd like to be able to compile this right into my au3 exe file.
  8. Has anybody ever solved this? I really want to add tasks to my taskbar entry.
  9. I've asked this question before but how can I make my AutoIt GUI taskbar icon support jumplists? I know of ITaskbarList3 but it only seems to concern itself with buttons and progress bars. What I'm specifically looking to do is when you right click on it have other tasks. The best example I can give is Internet Explorer, when you click on it whether the program is open or closed it has a section called tasks where it gives you options to do more than just open the program. Outlook 2013 also lets you right click and choose new mail message, new appointment, etc.
  10. Seems like all the old threads are dead ends on this topic. Does AutoIt support them? Will it ever? Thanks!
  11. I think if somebody knows how to convert this code this page I could make this work: http://support.microsoft.com/kb/186246 Set rs = cn.OpenSchema(adSchemaIndexes, _ Array(Empty, Empty, Empty, Empty, "Employees") While Not rs.EOF Debug.Print rs!INDEX_NAME rs.MoveNext Wend
  12. It might, but I'm guessing there is some more to this code. Like what is opening the connection and where does $adSchemaTables get set? Also, is there a schema attribute when doing this loop? like TABLE_SCHEMA ? I need to get a unique list of schemas.
  13. My most pressing problem is trying to get a list of schemas on a database. Anybody know how to do this? I've collected code I've found around the forums and tried something like this, which connects okay but errors out : $sqlCon = ObjCreate("ADODB.Connection") $sqlCon.Mode = 16; shared $sqlCon.CursorLocation = 3; client side cursor ; http://ns7.webmasters.com/caspdoc/html/syn...ion_strings.htm ; where [ip_address] is the IP address of the database server, [port_number] is the port for the database server, ; [database_name] is the name of the database, ; and [username] and [password] are the username and password required for accessing the database. ConsoleWrite("start" & @CRLF); $sqlCon.Open ("DSN=Database; UID=user; PWD=pass") If @error Then MsgBox(0, "ERROR", "Failed to connect to the database") Exit EndIf ConsoleWrite("cxn opened" & @CRLF); ; See also Catalog "ADOX Catalog Example.au3" $sqlRs = ObjCreate("ADODB.Recordset") If Not @error Then $sqlRs = $sqlCon.OpenSchema('adSchemaCatalogs') ConsoleWrite("schemas read" & @CRLF); If Not @error Then ;Loop until the end of file While Not $sqlRs.EOF ;Retrieve data from the following fields $OptionName = $sqlRs.Fields ('TABLE_SCHEMA' ).Value $sqlRs.MoveNext WEnd $sqlRs.close EndIf EndIf $sqlCon.Close This next code chunk gets me a list of tables, but I can't get the schemas. $adoxConn = ObjCreate("ADOX.Catalog") $sqlCon = ObjCreate("ADODB.Connection") $sqlCon.Open ("DSN=Database; UID=user; PWD=pass") $adoxConn.activeConnection = $sqlCon $sqlCon.CursorLocation = 3; client side cursor for $table in $adoxConn.tables ConsoleWrite($table.name & @CRLF) next
  14. My most pressing problem is trying to get a list of schemas on a database. Anybody know how to do this? I've collected code I've found around the forums and tried something like this, which connects okay but errors out : $sqlCon = ObjCreate("ADODB.Connection") $sqlCon.Mode = 16; shared $sqlCon.CursorLocation = 3; client side cursor ; http://ns7.webmasters.com/caspdoc/html/syn...ion_strings.htm ; where [ip_address] is the IP address of the database server, [port_number] is the port for the database server, ; [database_name] is the name of the database, ; and [username] and [password] are the username and password required for accessing the database. ConsoleWrite("start" & @CRLF); $sqlCon.Open ("DSN=Database; UID=user; PWD=pass") If @error Then MsgBox(0, "ERROR", "Failed to connect to the database") Exit EndIf ConsoleWrite("cxn opened" & @CRLF); ; See also Catalog "ADOX Catalog Example.au3" $sqlRs = ObjCreate("ADODB.Recordset") If Not @error Then $sqlRs = $sqlCon.OpenSchema('adSchemaCatalogs') ConsoleWrite("schemas read" & @CRLF); If Not @error Then ;Loop until the end of file While Not $sqlRs.EOF ;Retrieve data from the following fields $OptionName = $sqlRs.Fields ('TABLE_SCHEMA' ).Value $sqlRs.MoveNext WEnd $sqlRs.close EndIf EndIf $sqlCon.Close This next code chunk gets me a list of tables, but I can't get the schemas. $adoxConn = ObjCreate("ADOX.Catalog") $sqlCon = ObjCreate("ADODB.Connection") $sqlCon.Open ("DSN=Database; UID=user; PWD=pass") $adoxConn.activeConnection = $sqlCon $sqlCon.CursorLocation = 3; client side cursor for $table in $adoxConn.tables ConsoleWrite($table.name & @CRLF) next
×
×
  • Create New...