Auto install button at startup - different computers - same user?

A

Al

Hi Folks,

I have a little program that I have written and send to various users
on my network.

The program is installed by the user by running a batch file that I
attached to an email - the batch file installs the various .dot files
in the users /templates/ menu. All good so far.

The batch file also copies a file to the users /Application
Data/word/startup menu to install the button automatically when word is
started up. Now here the problem : we have heaps of computers at work
and more often than not a user will log on to a different computer each
time - the startup folder is specific to each machine their fore it
means the user must run the batch file for each different computer that
they use - a real pain in the ass.

I see one possible solution - howabout including in the batch file a
file that copies another batch file to the /Documents & Settings/All
Users/Startup folder - this second batch file copies the word file that
installs the button everytime a user logs on?

Anybody else have any better ideas?

-Al
 
S

Steve Yandl

Al,

I think you would have an easier time with a vbs file instead of a batch
file. You get a lot more fleximility in doing things like finding special
folders. If you company doesn't restrict the running of vbScript, you can
get some good ideas on one of the vbs groups.

As a start, if you create a vbs with the text below and it is in the same
folder as your template, myTemplate.dot, the template will be copied to the
user's "\Application Data\Microsoft\Word\STARTUP" folder

Dim fso
Dim objShell
Dim objFldrAppData
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
Set objFldrAppData = objShell.Namespace(&H1a&)
strWdStart = objFldrAppData.Self.Path & "\Microsoft\Word\Startup\"
fso.CopyFile "myTemplate.dot", strWdStart


Steve
 
S

Steve Yandl

Al,

Assuming your machines are Windows 95, 98, XP, or 2000+, you have all you
need to run VB script. VB script needs to be "hosted", in other words it
can run in an html file where the Internet Explorer is the host, or an hta
file where mshta.exe is the host or as a vbs file where the Windows Sciript
Host, WSH, is the host. It is similar to the way your batch file is
"hosted" by the command interpreter, either cmd.exe or command.com.

Create a new notepad file and copy the contents of what I have between the
dotted lines to this file:

--------------------------------------
Dim fso
Dim objShell
Dim objFldrAppData
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
Set objFldrAppData = objShell.Namespace(&H1a&)
strWdStart = objFldrAppData.Self.Path & "\Microsoft\Word\Startup\"
MsgBox strWdStart

------------------------------------

Save the change, close the file and rename it with a vbs extension. Double
click it and if vbs is set to go you should get a message box with the path
to your Word startup folder.

The big problem I encounter when sharing scripts is that people have the
default Explorer setting set to hide file extensions for known file types
and when they think they are naming the file myscript.vbs it is really
myscript.vbs.txt and it ends up opening in notepad instead of the script
running.

Steve



news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top