"TD" <> wrote in message
news:12CC7D9A-7655-476D-B8F5-...
>I am trying to write a script that I can launch from a login bat file that
>looks for a location of a program. Once the file location is found I want
>to take that location and dumps it to a reg key. Here's an example
>
> We want to set a default photo viewer on our network and would like to use
> Microsoft Office Picture Manager. I have found that this file can be
> located in different locations. On log in I would like the script to check
> basically 3 locations (c:\program files\Microsoft office\Office11,
> c:\program files\Microsoft office\Office12, and c:\program files\Microsoft
> office\ART\Office12) and then copy the path that is finds the OIS.exe file
> to a key in the registry.
>
> Can someone point me to the easiest cleanest way to do this.
>
>
> TIA
To see if a file exists, use the oFSO.FileExists method of the File System
Object. You will find the method fully explained (with an example!) in
script56.chm, a help file that you can (and should!) download from the
Microsoft site.
To insert a value into the registry, have a look here:
http://blogs.technet.com/heyscriptin...istry-key.aspx.
To download the whole Scripting Guy file (highly recommended!), look here:
http://www.microsoft.com/downloads/d...displaylang=en.
And if you want a very easy method to do the job, use a batch file. It has a
"if exist FileName" command and the tool reg.exe lets you create a new
registry key.