Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
newbie looking for file location
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
TD  
View profile  
 More options Nov 5 2009, 9:02 pm
Newsgroups: microsoft.public.windows.server.scripting
From: "TD" <t...@noreply.com>
Date: Thu, 5 Nov 2009 16:02:46 -0500
Local: Thurs, Nov 5 2009 9:02 pm
Subject: newbie looking for file location
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


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pegasus [MVP]  
View profile  
 More options Nov 5 2009, 9:18 pm
Newsgroups: microsoft.public.windows.server.scripting
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Thu, 5 Nov 2009 22:18:42 +0100
Local: Thurs, Nov 5 2009 9:18 pm
Subject: Re: newbie looking for file location

"TD" <t...@noreply.com> wrote in message

news:12CC7D9A-7655-476D-B8F5-CAE90D23D9F0@microsoft.com...

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/heyscriptingguy/archive/2006/11/16/how-can-i....
To download the whole Scripting Guy file (highly recommended!), look here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=5f5e0bda-923....

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.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jford  
View profile  
 More options Nov 9 2009, 2:04 pm
Newsgroups: microsoft.public.windows.server.scripting
From: jford <jf...@discussions.microsoft.com>
Date: Mon, 9 Nov 2009 06:04:06 -0800
Local: Mon, Nov 9 2009 2:04 pm
Subject: RE: newbie looking for file location

It works...

<batch>
@echo off

set loc1="C:\Program Files\Microsoft Office\Office11\OIS.exe"
set loc2="C:\Program Files\Microsoft Office\Office12\OIS.exe"
set loc3="C:\program files\Microsoft Office\ART\Office12\OIS.exe"

if exist %loc1% (
   call :regadd %loc1%
)
if exist %loc2% (
   call :regadd %loc2%
)
if exist %loc3% (
   call :regadd %loc3%
)
goto end
:regadd
reg add <keyname> /v <valuename> /d %1
:end
</batch>


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google