Im new to VBS Scripting, and I was assigned the task of converting our
batch files into VBSScript since we went to Active Directory 6 months
ago.
I can map drives and get a user and group membership (I think). But
what I am stumped at is checking for the existence of a LINKS folder on
the users desktop, and if it isnt there, create it. Then I need to dump
shortcuts and links into it depending on group membership.

In batch, I can use the %userprofile% command (in fact, here is a
snippet of batch that we use...)
Echo Checking Links Folder...
IF NOT EXIST "%userprofile%\desktop\Links" MKDIR
"%userprofile%\desktop\Links"
copy "\\DCSERVER\NETLOGON\LINKS\*.*" "%userprofile%\desktop\Links"

How could I make this into a logon script? This is one of the first
commands I use. Any help would be appreciated. I have looked for a VBS
Snippet on the net (Microsoft, VBSScripting.com and many others) but
could not find this. I can't believe I'm the only one who wants to do
this during login. Seems pretty basic to me that an Admin would want to
do this (at least in a K-12 school environment). Anyway Please help
me...

Re: Create a Folder on the users Desktop by OfficeGuyGoesWild

OfficeGuyGoesWild
Wed Dec 13 15:02:15 CST 2006

Hi Andy,

I have written a script for you that will test and create a file on a
users desktop, and then copy files to it from a remote server.

I have loaded it into TheScriptLibrary.com for you at this url:

http://www.thescriptlibrary.com/default.asp?Action=Display&Level=Category3&ScriptLanguage=VBScript&Category1=Desktop%20Management&Category2=Special%20Folders&Title=Create%20a%20Folder%20on%20a%20Users%20Desktop%20and%20Copy%20Files%20to%20it

Regards..Marty


Andy wrote:
> Im new to VBS Scripting, and I was assigned the task of converting our
> batch files into VBSScript since we went to Active Directory 6 months
> ago.
> I can map drives and get a user and group membership (I think). But
> what I am stumped at is checking for the existence of a LINKS folder on
> the users desktop, and if it isnt there, create it. Then I need to dump
> shortcuts and links into it depending on group membership.
>
> In batch, I can use the %userprofile% command (in fact, here is a
> snippet of batch that we use...)
> Echo Checking Links Folder...
> IF NOT EXIST "%userprofile%\desktop\Links" MKDIR
> "%userprofile%\desktop\Links"
> copy "\\DCSERVER\NETLOGON\LINKS\*.*" "%userprofile%\desktop\Links"
>
> How could I make this into a logon script? This is one of the first
> commands I use. Any help would be appreciated. I have looked for a VBS
> Snippet on the net (Microsoft, VBSScripting.com and many others) but
> could not find this. I can't believe I'm the only one who wants to do
> this during login. Seems pretty basic to me that an Admin would want to
> do this (at least in a K-12 school environment). Anyway Please help
> me...


Re: Create a Folder on the users Desktop by mr_unreliable

mr_unreliable
Thu Dec 14 11:31:42 CST 2006

hi Andy,

The desktop is a "special folder", and you can use this
code to find it:

set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")

From there, you can get the path to your folder by simply
appending the folder's name to the desktop path.

Then you can use fso, to determine whether the file exists,
and if it doesn't exist to create it.

From there, you can also use fso to read the contents of
an existing folder, or to add files to a new or existing
folder.

There are examples for all this stuff in the scripting
documentation.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)

Andy wrote:
> Im new to VBS Scripting, and I was assigned the task of converting our
> batch files into VBSScript since we went to Active Directory 6 months
> ago.
> I can map drives and get a user and group membership (I think). But
> what I am stumped at is checking for the existence of a LINKS folder on
> the users desktop, and if it isnt there, create it. Then I need to dump
> shortcuts and links into it depending on group membership.
>
> In batch, I can use the %userprofile% command (in fact, here is a
> snippet of batch that we use...)
> Echo Checking Links Folder...
> IF NOT EXIST "%userprofile%\desktop\Links" MKDIR
> "%userprofile%\desktop\Links"
> copy "\\DCSERVER\NETLOGON\LINKS\*.*" "%userprofile%\desktop\Links"
>
> How could I make this into a logon script? This is one of the first
> commands I use. Any help would be appreciated. I have looked for a VBS
> Snippet on the net (Microsoft, VBSScripting.com and many others) but
> could not find this. I can't believe I'm the only one who wants to do
> this during login. Seems pretty basic to me that an Admin would want to
> do this (at least in a K-12 school environment). Anyway Please help
> me...
>