copy a file to all users via a script instead of manually

I have a d:\users folder on my server.  inside users, each user has a folder 
named with their name.  inside each of those folders is a desktop folder.

I have a file on the C drive that I need to copy to each of those desktop 
folders, thereby giving each user this shortcut.  Does anyone have a script 
that could do that, instead of me copying this file manually a few hundred 
times?  many thanks if you do!
0
Utf
10/1/2010 1:59:03 AM
scripting.vbscript 564 articles. 0 followers. Follow

1 Replies
1083 Views

Similar Articles

[PageSpeed] 33

"Rich" <richjone@noemail.noemail> wrote in message 
news:5E68A580-FA4D-4B73-A548-0ED9D74AF34C@microsoft.com...
> I have a d:\users folder on my server.  inside users, each user has a 
> folder
> named with their name.  inside each of those folders is a desktop folder.
>
> I have a file on the C drive that I need to copy to each of those desktop
> folders, thereby giving each user this shortcut.  Does anyone have a 
> script
> that could do that, instead of me copying this file manually a few hundred
> times?  many thanks if you do!

  See if this does what you want:

Dim sSourceFile, sDestFolder, oFSO, oFolder, oSubFld
sSourceFile = "D:\My File.txt"
sDestFolder = "D:\Users Folder"

Set oFSO = CreateObject("Scripting.FileSystemObject")

Select Case False
 Case oFSO.FolderExists(sDestFolder)
  MsgBox sDestFolder & " does not exist!", vbExclamation, _
   "ERROR: Destination Folder"
  WScript.Quit
 Case oFSO.FileExists(sSourceFile)
  MsgBox sSourceFile & " does not exist!", vbExclamation, _
   "ERROR: Source File"
  WScript.Quit
End Select

Set oFolder = oFSO.GetFolder(sDestFolder)

For Each oSubFld in oFolder.Subfolders
 If oFSO.FolderExists(oSubFld & "\Desktop\") Then
  oFSO.CopyFile sSourceFile, oSubFld & "\Desktop\", True
 End If
Next

MsgBox "Complete!" 

0
James
10/2/2010 5:02:55 PM
Reply:

Similar Artilces:

Money cannot locate file...
I purchased a new computer with Money 2003 pre-loaded. I am running 2001 on the old computer which also came pre- loaded. When I attempt to run the old money file in the 2003 program, I get the message: Money cannot locate the file C:\My Money.mny or cannot open it, possibly because it is a read only file or you do not have permission to change it or the disk drive is write protected. It goes on to say I should make sure no one else is using it. I am certain the file is not protected, I am logged on as administrator, and I have copied the file using the LAN and a CD into numerous direc...

Insert file name into header
I need a macro or something that automatically insert the file name of the excel file into the header or footer, does not matter which, i dont need the directory path. Either this or automatically insert into the header or footer the contents of a specific cell in the worksheet. the cell address will never change., if i create a new worksheet, same cell address needs to go into the header thanks pat Try here: http://www.mrexcel.com/tip055.shtml best wishes -- Bernard V Liengme Microsoft Excel MVP www.stfx.ca/people/bliengme remove caps from email "Patrick" <Patrick@di...

Can't delete Outlook 2002 restored data files
My Windows XP Pro system crashed due to a hardware failure, and I had to restore my data once I reloaded a clean copy of Windows XP. I restored my Outlook data (PST files) to my D: drive thinking that I didn't want to overlay the current PST file, and would just import the data for it afterwards. I have managed to copy the data into my current Outlook PST file, but now I can't delete the folder structure that was created by my restore operation (i.e., "Documents and Settings" folder on D: drive) with all of its subfolders. I receive the error, "Cannot delete Ou...

Credit Card swip or manual?
I have two questions one is when I look at the credit card transactions in the journal it doesnt show any items that were rung up only the total of the credit card transaction. I would like to see what the customer bought as well. Next question Is there any way to make the reciept show manual or swiped entry for dispute reasons? Thanks for the help Doug, Control - right arrow on the journal screen will get you past the credit card receipt and into the detail receipt where you can see the sale details. Marc "Doug Pic-N-Pac" <DougPicNPac@discussions.microsoft.com>...

Creating records in one file whilst editing another file
I have a simple form which allows updates to records in an employee file. Each time a record is changed I would like to create an audit record in a separate file. I do not need any input from the user when creating the record as all the information is implied (date, time, user, before and after values etc.) I would be interested to know what people think the easiest way to do this would be...?? All opinions welcome - the more the merrier. Thanks, Jon. 88Caddy wrote: >I have a simple form which allows updates to records in an employee >file. Each time a record is changed I would ...

Return null (blank) instead of zero
I have written an expression using the IIF function. It evaluates two number fields and performs a calculation. I would like to display null (blank) if the expression returns a value of zero. Is this possible? If you want it to display blank then you can use the control's format to set that. Set the format as follows #;-#;"","" If you want it to BE null then you need to do the calculation and test the result and then either return Null or the value of the calculation So if your original IIF is IIF(A<>B,A*B,A) Then it now becomes IIF( IIF(A<&...

Workflow runs when manually fired but not automatic
I have tried everything that I can think of. Something that should be simple. Email to Case Application with EmailRouter pointed to email queu. Workflow determines Account by what is contained in the Subject of Email. Creates case with correct account accordingly.This fires and creates without issue, manually. Automatically, however, no luck. Workflow Expansion task states "succeeded". Case is not created. No errors, application events, etc. Any ideas, /jtk ...

Copies of messages
I have a client with SBS2003 including Exhange Server 2003. The client wants to be able to see all the email being sent to and sent from his employees. Is there a way to have a copy of all incoming emails go to another (the administrator?) mailbox? Is there a way to copy outgoing messages to another mailbox, too? If not, is there another way to accomplish the same thing so that the small business owner can monitor his employees' emails? Thanks, Mark http://www.exchange-forums.com/phpBB2/viewtopic.php?t=96 Will http://www.exchange-forums.com "MarkR" <MarkR@discus...

How to go back from 350 worksheet to the first worksheet in 1 file
Hi.. i hv 1 question to ask. Assume that i have more than 200 worksheet into 1 excel file, so imaging that i need to go back to the first worksheet from 350 page. So how should i do? Can i add the button like 'GO BACK TO FIRST PAGE' inside the 350 page, so when i click that button, it will go back to the first page, or any better suggesstion? Thanks in advanced. Regards, Wilmos Lee Hi try right-clicking with your mosue on the sheet navigation buttons in the lower left corner of your workbook. This should open a list of all your worksheets -- Regards Frank Kabel Frankfurt, Germany ...

Copy OE contacts
Need advice on copying my OE contacts on my old computer to my new computer (both are networked through a router). Halp! >Need advice on copying my OE contacts on my old computer >to my new computer (both are networked through a router). Please ask your question in a newsgroup that deals with Outlook Express. This one deals with Outlook. -- Brian Tillman Smiths Aerospace 3290 Patterson Ave. SE, MS 1B3 Grand Rapids, MI 49512-1991 Brian.Tillman is the name, smiths-aerospace.com is the domain. I don't speak for Smiths, and Smiths doesn't speak for me. ...

Trying to create a new Address List that includes both users and g
I am trying to use the "Create Exchange Address List" wizard in the Exchange System Manager under the Recipients folder. I want to create a list that includes users that meet a criteria and groups that meet a criteria. I can get a list of users or a list of groups filtered the way I want them, but I can't figure out how to get a list that includes both users and groups. I want to have the list available in the Address List drop-down list in Outlook. Any help would be appreciated. I just discovered that I can create two separate lists - one with the filtered users and ...

returning to file previously worked on after closing it.
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel In Appleworks, whenever I returned to the file I had been using (eg the manuscript I had been working on) the last page I had been editing would open up. But in Word, it always opens at the first page of the document and i have to scroll down many pages to reach the page I had been last working on. <br> Is there a short cut? A couple of the simplest & most direct solutions: Once the file opens key Command+End. If using a laptop or compact keyboard you may need to use the fn key along with that. ...

Script for delet old purchase order
I need help to creat script to delet old purchase order and time card year 03, to 2008 -- Thank You Harjit SherGill /DBA Altaville Market 324 South Main st po box 370 Altaville CA 95221 Tel : 209-736-1677 vendaliajat@yahoo.com ...

E-mail Addresses Tab Not Displaying in AD Users and Computers
Howdy, With Win2k3 & Exchange 2k3 SP2. I have several users that are not displaying the "E-mail Addresses" Tab on the properties of their user object. As well they do not list in the GAL. Any ideas or pointers would be helpful. Thanks, Dan Foxley That would suggest that they are not mail or mailbox enabled. In ADUC right click, Exchange tasks.... Nue <danfoxley@gmail.com> wrote in message news:1146514613.576153.123400@j33g2000cwa.googlegroups.com... > Howdy, > > With Win2k3 & Exchange 2k3 SP2. I have several users that are not > displaying the "...

excel e-mail file
i rcvd an e-mail with an excel doc. attach. i do not have microsoft excel on my computer. is there any other program that will open an excel doc. >-----Original Message----- >i rcvd an e-mail with an excel doc. attach. >i do not have microsoft excel on my computer. >is there any other program that will open an excel doc. >. >never mind, i was able to open it with microsoft access. Hi there is a free Excel viewer available at http://www.microsoft.com/downloads/details.aspx?FamilyID=4EB83149-91DA- 4110-8595-4A960D3E1C7C&displaylang=EN HTH Frank anonymous@discussions.m...

Select, copy, insert, then paste.
Sub CopyInsertPaste() Dim Sws As Worksheet, Dws As Worksheet Dim Val1 As Variant, Val2 As Variant Dim Val1Row As Long, Val2Row As Long, MyRow As Long Val1 = "AA22" Val2 = "BB33" Set Sws = Sheets("Sheet1") '<---Sheet copying from Set Dws = Sheets("Sheet2") '<---Sheet pasting to On Error Resume Next Val1Row = Sws.Range("A:A").Find(What:=Val1, After:=Sws.Range("A" & Rows.Count), LookIn:=xlFormulas, LookAt _ :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:= _ ...

receiving mdb files
I have Outlook 2000. I also have someone that needs to regularly send me Access mdb files, but Outlook 2000 is blocking them; how do I get Outlook 2000 to NOT DO THAT? : } "Lisa Simpson" <noone@nowhere.com> wrote in message news:OsvVaR$9EHA.2192@TK2MSFTNGP14.phx.gbl... >I have Outlook 2000. I also have someone that needs to regularly send >me > Access mdb files, but Outlook 2000 is blocking them; how do I get > Outlook > 2000 to NOT DO THAT? : } > > Tell your sender to rename the file to <filename>.mdx (or whatever extension you like that...

Publsher cannot open the file
I created a calendar in publisher and tried to open it today to update it. I keep getting the above message. I have tried the following 1. Turning off Norton Anti-Virus 2. Opening the file on 3 different computers, one of which is not running Norton 3. Opening the file in Safe Mode Nothing is working! I have several graphics embedded in the publication - all from microsoft. I really don't want to waste another day redoing the entire publication. Any suggestions? cslviola wrote: > I created a calendar in publisher and tried to open it > today to update it. I keep getting th...

Problem Opening Files #2
When an attempt to open an Exel file by double clicking on the file icon in Windows Explorer the Exel window opens (without any workbook present) and the following error message is displayed: "Cannot find the file 'C:\***.XLS (or one of its components) Make sure the path (... etc)" The file can be opened by using the open command within Exel. This problem first appeared while running MS Office under Windows 98 but has persisted since upgrading to Windows 2000 Professional. I have tried Windows update and repairing the program automatically from 'ADD / REMOVE PROGRA...

How do I match a color from copied web logo to my text in publishe
I am using Publisher 2003. I am making an internal flyer for my company and I pulled their logo off the intranet and put it in the banner headline. I want to take 2 specific colors in that logo and make one the backround in the adjacent text box and the other the color of the text itself. Is there a way to sample the logo color(s) and have the computer autmatically match it or does it have to be done by trial and error? If the latter is the case, what is the best way to do it so as to minimize error? Thanks You can look at the hex number of the colors but there's no guarantee tha...

Restrict User Security
Hi, Is there a way to prevent a user who has access to "User Security" window, from assigning self to the "POWERUSER" role? We have 1 system admin who has system wide access. We also have a support team, who only have permissions to create and maintain users - User Setup, User Access and User Security. We would like to prevent the support users to grant the "POWERUSER" role to themselves. Thanks, Sandeep. Lets think this through. if there was a way to block POWERUSER assignments, then what would prevent them from simply assigning every role to themselve...

Inserted Picture
I have inserted a picture into a spreadsheet. When I try to move picture, there are multiple copies of the picture there. Is there a way that I can view the underlying code (picture) so that I can see how many copies of the picture are present and delete the extras in one operation? You can show the drawing toolbar and click on the arrow icon. Then you can lasso the area that surrounds those pictures and hit the delete key. This will delete all the pictures, so you may want to save the top picture if you need it. jkbob@optonline.net wrote: > > I have inserted a picture into a spr...

copy Outgoing mails via the server
how can i copy all the outgoing mails via the server to another mail box ? click properties on the store object, and there you have an option to fowored all mails to a specific mailbox. "Indika Gamage" <indikag@hotmail.com> wrote in message news:04d501c46e2b$a7c06730$a401280a@phx.gbl... > how can i copy all the outgoing mails via the server to > another mail box ? what u mean by store object? pls explane the steps >-----Original Message----- >click properties on the store object, and there you have an option to >fowored all mails to a specific mailbox. &...

ost files
We have people that use Outlook 2003 with an Exchange account. The Exchange acounts are hosted by our ISP. I want to know what is the best practice to backup et restore the Outlook 2003 files with an Exchange account. Let say a user has accidently deleted a folder in the Inbox and I want to restore it. With an Exchage account, the outlook file format is ost. Can I backup and resotre juste the ost file. Thanks for your response -- Shidewa Assuming that the Exchange application service provider has deleted item retention turned on, you should be able to use the dumpsteralwayson registry ...

How do I save multiple messages as text file?
When I select multiple messages -> file -> save as text file. Only the headers of the messages are saved and not the bodies. In Outlook 2003, how do I save the bodies also? Thanks. ...