Jump to content
Sign in to follow this  
savj14

Openeing a Text File

Recommended Posts

savj14

I am trying to create a simple text file that contains the IP Config /all information on a machine. I then want to open the text file for the user automatically. I can write the file it just won't open.........I'd like it to open in notepad if possible,

What am I doing wrong?? I don't think FileOpen is making much sense to me.

#include <GUIConstants.au3>
#include <File.au3>
#NoTrayIcon

Run(@ComSpec & " /c " & 'cmd.exe', "", @SW_SHOW)
WinWaitActive("C:\WINDOWS\system32\cmd.exe")
Send("ipconfig /all >c:\ipconfig.txt")
Send("{ENTER}")
Sleep(1000)
Send("exit")
Send("{ENTER}")
FileOpen("c:\ipconfig.txt",2)

Share this post


Link to post
Share on other sites
herewasplato

...

I am trying to create a simple text file that contains the IP Config /all information on a machine. I then want to open the text file for the user automatically...

RunWait(@ComSpec & ' /c ipconfig /all > ipconfig.txt', "", @SW_HIDE)
ShellExecute("ipconfig.txt")
Adjust the path to ipconfig.txt as desired.

[size="1"][font="Arial"].[u].[/u][/font][/size]

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  

×