Jump to content
Sign in to follow this  

Read data from a variable and and paste it in text file

Recommended Posts

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


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")




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 by chaitu


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...