Re: SMS Installer Variables

Tech-Archive recommends: Fix windows errors by optimizing your registry



This can work. I would add in some logic to weed out profiles that don't
need it like Network Service, etc... You will also need code to parse out
the specific information that will be useful.

There are also other ways to enumerate the profiles on a machine either
using the registry (profilelist) or by searching for ntuser.ini's.

As to your other question, like shown below you can use several ways to show
a message on the screen or in a file. Display message, custom dialog,
piping to a text file, writing to a log file, throwing information to a
command window....

Good luck
Terry

"Greg Ramsey" <ramseyg@xxxxxxxxxxxxxxxxxxx> wrote in message
news:%23q41hxo9FHA.3876@xxxxxxxxxxxxxxxxxxxxxxx
> Someone else may have a better solution, but here's what I've done in the
> past.
>
> Execute program (and wait) -- do a "dir /b "c:\documents and settings"
> >%temp%\profiles.txt
> then read text file to get each profile name
>
> You will probably still want to put it into "default user", so when a new
> user logs on he/she will have the template.
>
> copy & paste everything below into SMS installer for an example:
> (you could also include some "if statements" to exclude specific profiles
> if desired (e.g. administrator)
>
> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''code start
> after this line''''''''''''''''''''''''''''''''
> item: Check Disk Space
> end
> item: Execute Program
> Pathname=cmd.exe
> Command Line=/c dir /b "c:\documents and settings" >%temp%\profiles.txt
> Flags=00000010
> end
> item: Read/Update Text File
> Variable=username
> Pathname=%temp%\profiles.txt
> end
> item: Display Message
> Title English=username
> Text English=%username%
> Text English=
> Text English=
> Text English=c:\documents and settings\%username%\desktop
> end
> item: End Block
> end
> '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''code end
> before this line''''''''''''''''''''''''''''''''
>
>
>
> "Mikecl" <mike_clark_2@xxxxxxxxxxx> wrote in message
> news:OVRXtKo9FHA.3592@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi,
>>
>> I have written a script to copy a word template to the C:\documents and
>> Settings\username\Application Data\Microsoft\Templates but I have a
>> couple
>> of issues 1 is getting the logged on user so I thought of using the
>> defaultusername. However the files did not get copied to the correct
>> place
>> and although running the script on the server seems to show the correct
>> variables I am not sure how to output them to the screen or file so I can
>> see what is going on. Can anyone help please?
>>
>> Thanks
>>
>> ============================================================================
>> =========
>>
>> item: Remark
>> Text=Get Variables
>> end
>> item: Check Disk Space
>> end
>> item: Parse String
>> Source=%WIN%
>> Pattern=\
>> Variable1=SYSDRIVE
>> end
>> item: Open/Close INSTALL.LOG
>> Pathname=%SYSDRIVE%\committee.log
>> Flags=00000010
>> end
>> item: Open/Close INSTALL.LOG
>> end
>> item: Get Registry Key Value
>> Variable=CTEMPLATES
>> Key=SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
>> Value Name=Common Templates
>> Flags=00000100
>> end
>> item: Get Registry Key Value
>> Variable=DEUSERNAME
>> Key=SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
>> Value Name=DefaultUserName
>> Flags=00000100
>> end
>> item: Set Variable
>> Variable=DOCS
>> Value=Document and Settings
>> Flags=00010100
>> end
>> item: Set Variable
>> Variable=USRTEMPLATE
>> Value=Application Data\Microsoft\Templates
>> Flags=00010100
>> end
>> item: Set Variable
>> Variable=USRTEMPLATES
>> Value=%SYSDRIVE%\%DOCS%\%DEUSERNAME%\%USRTEMPLATE%
>> Flags=00010100
>> end
>> remarked item: Check if File/Dir Exists
>> Pathname=%USRTEMPLATES%\Sutrep*.dot
>> Flags=00000100
>> end
>> item: Delete File
>> Pathname=%USRTEMPLATES%\Sutrep*.dot
>> end
>> remarked item: Check if File/Dir Exists
>> Pathname=%USRTEMPLATES%\Committee Rep 2005.dot
>> Flags=01000100
>> end
>> item: Remark
>> Text=Check for Template version
>> end
>> remarked item: If/While Statement
>> Variable=REPORT
>> Value=1.1
>> Flags=00000001
>> end
>> item: Copy Local File
>> Source=%INST%\Committee Rep 2005.dot
>> Destination=%USRTEMPLATES%\Committee Rep 2005.dot
>> Flags=0000000001000010
>> end
>> item: Copy Local File
>> Source=%INST%\Committee Rep 2005.dot
>> Destination=%CTEMPLATES%\Committee Rep 2005.dot
>> Flags=0000000001000010
>> end
>> item: Copy Local File
>> Source=%INST%\Committee Rep 2005.dot
>> Destination=%USRTEMPLATES%\Committee Rep 2005.exe
>> Flags=0000000001000010
>> end
>> item: Copy Local File
>> Source=%INST%\Committee Rep 2005.dot
>> Destination=%CTEMPLATES%\Committee Rep 2005.exe
>> Flags=0000000001000010
>> end
>> item: Open/Close INSTALL.LOG
>> Flags=00000001
>> end
>> item: Exit Installation
>> Variable=0
>> Flags=0
>> end
>>
>>
>
>


.



Relevant Pages

  • Re: change normal.dotx for mandatory profile in domain
    ... I am not sure which "startup" folder you are referring to. ... profiles the cache is deleted with the user logs off. ... Microsoft Word MVP ... template there, the default still loads. ...
    (microsoft.public.word.docmanagement)
  • Re: How to set default margins for all new users who log in?
    ... It's okay to delete all existing profiles such ... - Set up a shared folder on the network (or a folder on the machine, ... additional template as an Addin and have it copied to the users StartUp folder. ... This reply is posted in the Newsgroup; please post any follow question or reply in the ...
    (microsoft.public.word.pagelayout)
  • Re: How to set default margins for all new users who log in?
    ... It's okay to delete all existing profiles such ... > that when the user logs on, a new profile is created with the modified template, but ... > - Put the templateall the users should share in this folder. ... > additional template as an Addin and have it copied to the users StartUp folder. ...
    (microsoft.public.word.pagelayout)
  • Re: Unable to copy roaming user profile
    ... Note that roaming profiles are not always the right tool for the job - ... template for all user profiles). ... Then log in as your domain admin /equivalent account and try using ...
    (microsoft.public.windowsxp.security_admin)
  • Re: custom templates usable by all users
    ... network of over a thousand users and the profiles are all stored locally. ... >> I have to copy paste this template in all the user profile folders? ... > Put the template in any folder that can be accessed by all of the profiles. ...
    (microsoft.public.word.docmanagement)