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

Re: Auto install button at startup - different computers - same user? by Steve

Steve
Mon May 09 19:40:57 CDT 2005

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


"Al" <bigal_nz@hotmail.com> wrote in message
news:1115681494.678153.296170@f14g2000cwb.googlegroups.com...
> 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
>



Re: Auto install button at startup - different computers - same user? by Al

Al
Mon May 09 20:44:33 CDT 2005

Don't know much about VB script - what do I have to have installed to
run it?

-Al


Re: Auto install button at startup - different computers - same user? by Steve

Steve
Mon May 09 21:12:35 CDT 2005

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


"Al" <bigal_nz@hotmail.com> wrote in message

news:1115689473.487735.269570@z14g2000cwz.googlegroups.com...
> Don't know much about VB script - what do I have to have installed to
> run it?
>
> -Al
>



Re: Auto install button at startup - different computers - same user? by Al

Al
Tue May 10 06:51:04 CDT 2005

I get an error on line 7 - char 66 Error: unterminated string
constant??

-Al


Re: Auto install button at startup - different computers - same user? by Steve

Steve
Tue May 10 09:19:20 CDT 2005

Make sure the final quotation mark got included in line 7. The fact that
you got the error message indicates that you can run scripts. Visit
http://www.microsoft.com/technet/scriptcenter/default.mspx for samples,
information and links on scripting.

Steve


"Al" <bigal_nz@hotmail.com> wrote in message
news:1115725864.835804.35230@f14g2000cwb.googlegroups.com...
>I get an error on line 7 - char 66 Error: unterminated string
> constant??
>
> -Al
>