Sign in to follow this  
Followers 0
Doppio

Open Program With saved settings Settigs

8 posts in this topic

I have a shortcut called ATS that when opened with notepad shows the following:

[Profile]

ID=WS

Version=6

[Telnet3270]

HostName=10.2.41.41

LUName=R00N405

Security=N

AutoReconnect=Y

[Communication]

Link=telnet3270

[3270]

QueryReplyMode=Auto

HostCodePage=037-U

[Keyboard]

CuaKeyboard=1

Language=United-States

DefaultKeyboard=$$BLANK$$

If I go to the shortcut properties it says that it opens with ( PCSWS.EXE ) ,which is a mainframe application that reads these settings and configures a mainframe session when openned.

My question to anyone out there, how can I write a script that would do the same as the ATS shortcut?

Thank you.

Share this post


Link to post
Share on other sites



well, if you want to read/write settings and stuff to ini files, look at the following functions in your autoit help file:

IniWrite ( "filename", "section", "key", "value" )

IniRead ( "filename", "section", "key", "default" )

IniDelete ( "filename", "section" [, "key"] )

Hope that helps :whistle:

Share this post


Link to post
Share on other sites

well, if you want to read/write settings and stuff to ini files, look at the following functions in your autoit help file:

IniWrite ( "filename", "section", "key", "value" )

IniRead ( "filename", "section", "key", "default" )

IniDelete ( "filename", "section" [, "key"] )

Hope that helps :whistle:

I want ( PCSWS.EXE ) my mainframe application to read the settings from an AutoIt script, and I just can't figure out how to do it. I'm aware of IniRead and IniWrite, I'm not looking to read and write to an ini file I want my script to be able to have this settings in it, like this:

#include <GuiConstants.au3>

[Profile]

ID=WS

Version=6

[Telnet3270]

HostName=10.2.41.41

LUName=R00N405

Security=N

AutoReconnect=Y

[Communication]

Link=telnet3270

[3270]

QueryReplyMode=Auto

HostCodePage=037-U

[Keyboard]

CuaKeyboard=1

Language=United-States

DefaultKeyboard=$$BLANK$$

run (C:\Program Files\IBM\Personal Communications\pcsws.exe)

This is the best way I can explain it, I'm sorry If cI can't be more precise.

Share this post


Link to post
Share on other sites

I want ( PCSWS.EXE ) my mainframe application to read the settings from an AutoIt script, and I just can't figure out how to do it. I'm aware of IniRead and IniWrite, I'm not looking to read and write to an ini file I want my script to be able to have this settings in it, like this:

#include <GuiConstants.au3>

[Profile]

ID=WS

Version=6

[Telnet3270]

HostName=10.2.41.41

LUName=R00N405

Security=N

AutoReconnect=Y

[Communication]

Link=telnet3270

[3270]

QueryReplyMode=Auto

HostCodePage=037-U

[Keyboard]

CuaKeyboard=1

Language=United-States

DefaultKeyboard=$$BLANK$$

run (C:\Program Files\IBM\Personal Communications\pcsws.exe)

This is the best way I can explain it, I'm sorry If cI can't be more precise.

Sounds like you just want to make them an array:

Dim $Profile[2][2]
$Profile[1][0] = 'ID'
$Profile[1][1] = 'WS'
;Etc...

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Sounds like you just want to make them an array:

Dim $Profile[2][2]
$Profile[1][0] = 'ID'
$Profile[1][1] = 'WS'
;Etc...
tha's what I want I will try it and let you know.

Share this post


Link to post
Share on other sites

I'm having problems understanding how to do it, can you please do the five first lines? thank you

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I'm having problems understanding how to do it, can you please do the five first lines? thank you

Dim $Profile[3][2]
$Profile[1][0] = 'ID';[0] will be the "key"
$Profile[1][1] = 'WS';[1] will be the value
$Profile[2][0] = 'Version'
$Profile[2][1] = 6

Dim $Telnet3270[5][2]
$Telnet3270[1][0] = 'HostName'
$Telnet3270[1][1] = 'W10.2.41.41'
$Telnet3270[2][0] = 'LUName'
$Telnet3270[2][1] = 'R00N405'
$Telnet3270[3][0] = 'Security'
$Telnet3270[3][1] = 'N'
$Telnet3270[4][0] = 'AutoReconnect'
$Telnet3270[4][1] = 'Y'

;The above is the long way to do
Dim $Profile = IniReadSection('FileLocation.ini', 'Profile')
Dim $Telnet3270 = IniReadSection('FileLocation.ini', 'Telnet3270')

Edit:

Not only is IniReadSection() shorter, but more efficient, as I made 2 errors originally in displaying it :whistle:

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I will try and let you know. Thank you again.

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  
Followers 0