Sign in to follow this  
Followers 0
dbs179

Is this even possible

4 posts in this topic

Hey all,

I have used AutoIt in the past to help make an unattended install disc but my experience with GUI's is a bit limited. Here is what I am trying to do. Due to network privileges, I am unable to configure my pc's NIC card to a Static IP address. However, I do have a local Administrators account and password that lets me make these changes. Rather than logging off every time I need to change my IP I am trying to come up with a GUI that will automate this as much as possible. I have also come up with a few batch files that cut down on entering text into the command prompt, but that is even a pain since I need to edit each command file every time I have a different IP to assign.

So I guess my question is this, Can autoIT launch a command prompt using the runas command using a user name and password that is put into a gui, and then input the netsh command needed to change an ip address thru the command propmt, using variables that are input into another GUI, such as IP address, Subnet Mask, Default Gateway and DNS Server if needed. I know all of the command prompt lines I need, I just don't know if autoit can add the variable in at the correct place, or launch a command prompt with the run as command.

Any help offered will be greatly appreciated.

Thanks

Share this post


Link to post
Share on other sites



Hey all,

I have used AutoIt in the past to help make an unattended install disc but my experience with GUI's is a bit limited. Here is what I am trying to do. Due to network privileges, I am unable to configure my pc's NIC card to a Static IP address. However, I do have a local Administrators account and password that lets me make these changes. Rather than logging off every time I need to change my IP I am trying to come up with a GUI that will automate this as much as possible. I have also come up with a few batch files that cut down on entering text into the command prompt, but that is even a pain since I need to edit each command file every time I have a different IP to assign.

So I guess my question is this, Can autoIT launch a command prompt using the runas command using a user name and password that is put into a gui, and then input the netsh command needed to change an ip address thru the command propmt, using variables that are input into another GUI, such as IP address, Subnet Mask, Default Gateway and DNS Server if needed. I know all of the command prompt lines I need, I just don't know if autoit can add the variable in at the correct place, or launch a command prompt with the run as command.

Any help offered will be greatly appreciated.

Thanks

1. Have AutoIt assemble all the required parameters as variables.

2. Use RunAsSet() to provide the credentials.

3. Use Run() or RunWait() to execute a NETSH.EXE command line.

Hopefully you are doing this on a laptop that changes networks. If I managed a network with DHCP and you started setting static IPs on it without permission, I would hunt down your machine and disable it until you convinced management to tell me to turn it back on. But that's just me...

Merry Christmas!

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Hey all,

I have used AutoIt in the past to help make an unattended install disc but my experience with GUI's is a bit limited. Here is what I am trying to do. Due to network privileges, I am unable to configure my pc's NIC card to a Static IP address. However, I do have a local Administrators account and password that lets me make these changes. Rather than logging off every time I need to change my IP I am trying to come up with a GUI that will automate this as much as possible. I have also come up with a few batch files that cut down on entering text into the command prompt, but that is even a pain since I need to edit each command file every time I have a different IP to assign.

So I guess my question is this, Can autoIT launch a command prompt using the runas command using a user name and password that is put into a gui, and then input the netsh command needed to change an ip address thru the command propmt, using variables that are input into another GUI, such as IP address, Subnet Mask, Default Gateway and DNS Server if needed. I know all of the command prompt lines I need, I just don't know if autoit can add the variable in at the correct place, or launch a command prompt with the run as command.

Any help offered will be greatly appreciated.

Thanks

Welcome to the forums.

These questions suggest that you haven't taken the time or interest to read the help files.

You must, IMO, try to understand the very good examples given in the help.

Also, have a look at Valuater's excellent thread for learning AutoIt.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

PSaltyDS and Martin,

Thank you both for the quick responses. I have had a quick look at the examples in the help file and at Valuaters AutoIT 1-2-3. I guess I didn't get far enough in either. I did do some searching as well and found a very similar thread buried about 12 pages back. I think I have the answer I need now and can try to figure this all out.

My skills are very limited in this type of thing, but I figured I'd give it a try. As for DSalty's question about my Network Admins they know what I'm doing and it is already signed off on. I set up a lot of Ethernet Serial Servers on private LAN's that don't use DHCP, so that is why this tool would come in handy.

Thanks again for answering my questions and pointing me in the right direction.

Dave

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