chaitanyagutala Posted April 16, 2010 Posted April 16, 2010 (edited) Hi all, I am trying to write a script which will check whether open office is installed in a machine or not. If installed it should get the hostname and copy it to text file in c drive.With the below script I am able to get whether open office is installed or not . can anyone please give me some suggestion how can I read value from the variable('$openoffice' in the script) and send the value to text file in c drive. I have 50 machines and I am trying to create a group policy and implement this.If open office is installed the machine's hostname should be redirected to C:\hosts.txt file. If open office is not installed then move to next machine. Please check my script #include<process.au3> if FileExists("C:\Program Files\OpenOffice.org 3\program\") Then $openoffice =RegRead("HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ComputerName\ActiveComputerName","ComputerName") _RunDOS( "$openoffice > C:\host.txt") Else Exit EndIf using the above script it is reading data from registry. so that we can come to know open office is installed or not.I am trying to use _RUNDOS command to redirect the value from $openoffice to C:\hosts.txt file but I am not able to do that.Please help me out. Edited April 16, 2010 by chaitu Thanks
99ojo Posted April 16, 2010 Posted April 16, 2010 Hi, try this: if FileExists("C:\Program Files\OpenOffice.org 3\program\") Then $file = FileOpen ("c:\hosts.txt", 2) FileWrite ($file, @ComputerName) FileClose ($file) Else Exit EndIf ;-)) Stefan
chaitanyagutala Posted April 16, 2010 Author Posted April 16, 2010 Thank you very much dude I ll try it and let you know thank you again Thanks
chaitanyagutala Posted April 28, 2010 Author Posted April 28, 2010 Thats working dude. Thank u very much Thanks
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now