Jump to content
Sign in to follow this  
sno

Environment permanent / print to cmd box

Recommended Posts

Still i have two questions more:

1. I want to set environment in a permanent way so that it is available in a later user session for other programs to use. What is the best way of doing so?

2. is there a debug,print,println option to send text to de command box, andso why cant i find it in the help :( or beter wat are my alternatives? CallDll() ?

thx in advance


Grtx Sno. The Novice Newbie.

Share this post


Link to post
Share on other sites

isn t this suppose to be a simple question, somebody?


Grtx Sno. The Novice Newbie.

Share this post


Link to post
Share on other sites

Still i have two questions more:

1. I want to set environment in a permanent way so that it is available in a later user session for other programs to use. What is the best way of doing so?

2. is there a debug,print,println option to send text to de command box, andso why cant i find it in the help :( or beter wat are my alternatives? CallDll() ?

thx in advance

<{POST_SNAPBACK}>

1. On NT/2000/XP, RegWrite your variables to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment and then call EnvUpdate() to activate the changes

2. Use Scite and ConsoleWrite

Edited by SumTingWong

Share this post


Link to post
Share on other sites

1. On NT/2000/XP, RegWrite your variables to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment and then call EnvUpdate() to activate the changes

2. Use Scite and ConsoleWrite

<{POST_SNAPBACK}>

2. ConsoleWrite() help -> "This does not write to a DOS console",

But i do want to write to the dos console.


Grtx Sno. The Novice Newbie.

Share this post


Link to post
Share on other sites

In writing to the dos command line. Are you attempting to execute some commands? Intereact with a running program? Or just look at some raw output?

Let me know, each has it's own solution. To write to the DOS command window would yield invalid command errors if you are just trying to list text. You can do a send to send the characters to the dos window, but - again - this won't yield what you are expecting - I think.

To list text while you watch for program testing - the consolewrite is the best solution.

Otherwise, store your output to a text file and call notepad file.txt to display the output.

If you are attempting to monitor progress, you could create a multiline edit control and just send the text to the control. It would autoscroll.

;#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 316,(@DesktopWidth-392)/2, (@DesktopHeight-316)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Button_1 = GuiCtrlCreateButton("Simulate Input", 2, 2, 100, 40)
$Input_1 = GuiCtrlCreateEdit("Input1", 45, 45, 300, 240)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    case $msg = $Button_1
        GUICtrlsetdata($Input_1,GUICtrlRead($Input_1) & @CRLF & "CURRENT TIME : " & @hour & ":" & @MIN & ":" & @SEC )
    Case Else
    ;;;
    EndSelect
WEnd
Exit
#endregion --- GuiBuilder generated code End ---

Share this post


Link to post
Share on other sites

Still i have two questions more:

1. I want to set environment in a permanent way so that it is available in a later user session for other programs to use. What is the best way of doing so?

AutoIT-script "SendValue.exe" containing:

Console(@ProgramFilesDir)

DOS batchfile:

For /F "Tokens=*" %%a in ('"SendValue.exe"') Do Set EnvValue=%%a

Echo %EnvValue%

Best Regards

Jan Fredsholt

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...