Copy file using VBScript?

Base

New Member
Joined
Oct 5, 2005
Messages
37
Hi all,

Can anyone help me with VBScript syntax to copy a file from a folder under c:\program files\ to the desktop.

or else to create a shortcut of a specific file.

I can't seem to get the syntax right.

Thanx
Base
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
I am assuming you mean in Access VBA, since you posted it in the Access board.

If so, take a look at "FileCopy" and "CopyFile" in Access VBA help.
 
Upvote 0
Hi jmiskey,

To tell you the truth - I was looking for the VBScript syntax. The thing is other forums are not like this one (where people actually answer you). So I tried posting it on VBScript website forums but no answer. Hence me coming back here to check for someone with cross-know-how.

I did come right with the syntax (but using a .bat file) but my major problem was that I wanted to create a shortcut on all my client's desktop (Win95 -> XP). But as you know with later versions of Win the desktop no longer sits at C:\windows\desktop. So I ended up with the following batch file:

C:
cd program files\clubbase
copy clubbase.lnk "c:\documents and settings\all users\desktop"
copy clubbase.lnk "C:\Windows\Desktop"

To make sure the shortcut gets created on all versions of Windows.

Thanks for your help though
Base
 
Upvote 0

Forum statistics

Threads
1,224,876
Messages
6,181,519
Members
453,050
Latest member
Obil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top