Re: vbscript to save file to a folder under user profile



Chris wrote:
sorry for my poor scripting knowledge. how does that help me to
define the folder path since it varies based on logon ID? I saw some
profile folders are names under userid and others are in the format
as userid.domainname. If I can get the proper folder name of the
profile as the user logs on then I can specify the path with that
folder variable. Is it the right way to do? how to get there?

Set objWshShell = WScript.CreateObject("WScript.Shell")

WScript.Echo "UserProfile=" & _
objWshShell.Environment("PROCESS")("UserProfile")

WScript.Echo "HomePath=" & _
objWshShell.Environment("PROCESS")("HomeDrive") _
& objWshShell.Environment ("PROCESS")("HomePath")

By the way, open a dos box and enter "set" (no quotes)
you will obtain a partial list of system variables.


.



Relevant Pages

  • Re: Moving messages to folder in PST file.
    ... It was developed specifically to move messages to a folder ... Modify the destination folder path information to fit your ... Dim currentMessage As MailItem ... Dim objDestinationFolder As Outlook.MAPIFolder ...
    (microsoft.public.outlook.program_vba)
  • Re: vbscript to save file to a folder under user profile
    ... define the folder path since it varies based on logon ID? ... profile folders are names under userid and others are in the format ... Set objWshShell = WScript.CreateObject ...
    (microsoft.public.scripting.vbscript)
  • Re: Need macro to always go to the same folder
    ... I of course do not have a folder ... but whatever folder path I use in place of that folder path in the following ... Peggy Duncan, Author ... Exit Sub ...
    (microsoft.public.word.vba.general)
  • Re: Public Folder Path
    ... You can, of course, build a folder path from the MAPIFolder object by ... Sue Mosher, Outlook MVP ...
    (microsoft.public.outlook.program_addins)
  • Re: Script for changing the registry key value
    ... I am able to add values to the registry key using wshshell.regwrite command, ... but I want to add the exact expanded value of the folder path to the ... set WshShell = WScript.CreateObject ... their temp folder path for all users at a time on a computer. ...
    (microsoft.public.scripting.vbscript)

Loading