How can I change this? 
Author Message
 How can I change this?

Hi,

Real new to scripts here and need a little help.
I have a vbs script that I'm trying to modify to only copy the user.dat
and system.dat to a folder already created. With the code below it
will copy all dat files from Windows to this folder, but how do I change
this to only copy the two files in question?.

SET Tfolder = FSO.GetSpecialFolder(WindowsFolder)
datfile = Tfolder & "\*.dat"

Thanks,
--
SG
NOTE: Please post to the group...e-mail is invalid.
The Microsoft Knowledge Base   http://www.*-*-*.com/
Additional Help: http://www.*-*-*.com/



Fri, 28 Dec 2001 03:00:00 GMT  
 How can I change this?
You'll need to do 2 separate copies, explicitly naming each file.

When you use explicit file names targeting a folder, you _must_ include the
final "\" in the target folder path otherwise it is interpreted as a file
name (without an extension) and you'll get a "Permission denied" error.

When you use wildcards in the source, the target is always assumed to be a
folder, even without the final "\".

--
Michael Harris


| Hi,
|
| Real new to scripts here and need a little help.
| I have a vbs script that I'm trying to modify to only copy the user.dat
| and system.dat to a folder already created. With the code below it
| will copy all dat files from Windows to this folder, but how do I change
| this to only copy the two files in question?.
|
| SET Tfolder = FSO.GetSpecialFolder(WindowsFolder)
| datfile = Tfolder & "\*.dat"
|
| Thanks,
| --
| SG
| NOTE: Please post to the group...e-mail is invalid.
| The Microsoft Knowledge Base
http://support.microsoft.com/support/a.asp?M=S
| Additional Help: http://www.mvps.org/links.html
|
|



Fri, 28 Dec 2001 03:00:00 GMT  
 How can I change this?

Quote:
>>You'll need to do 2 separate copies, explicitly naming each file<<

Michael,

Thanks for the response...
Are you saying I need to seperate vbs files to do this?. Sorry I don't quite
understand.

--
SG
NOTE: Please post to the group...e-mail is invalid.
The Microsoft Knowledge Base  http://support.microsoft.com/support/a.asp?M=S
Additional Help: http://www.mvps.org/links.html



Fri, 28 Dec 2001 03:00:00 GMT  
 How can I change this?
No, I'm saying you'll have...

fso.CopyFile sourcefilename1, targetfoldername
fso.CopyFile sourcefilename2, targetfoldername

in the script.

--
Michael Harris

| >>You'll need to do 2 separate copies, explicitly naming each file<<
|
| Michael,
|
| Thanks for the response...
| Are you saying I need to seperate vbs files to do this?. Sorry I don't
quite
| understand.
|
| --
| SG
| NOTE: Please post to the group...e-mail is invalid.
| The Microsoft Knowledge Base
http://support.microsoft.com/support/a.asp?M=S
| Additional Help: http://www.mvps.org/links.html
|
|



Fri, 28 Dec 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Change Primary DNS suffix when domain membership changes

2. How to change cell color or font color when data changed

3. printing a changed document.body without changing the existing document.body

4. xcopy changes from a file to multiple network pc's any time a change is made.

5. Change SMTP server in IIS to SMTPD32.exe

6. Save Changes to .rtf file in a frameset

7. Changing the Title of the Web Page

8. Change mousepointer?

9. changing innerHTML

10. Need HELP to changing mouse pointer

11. Changing Printer Setup within the browser with VB Script

12. Changing a files permissions from ASP and FSO eeep

 

 
Powered by phpBB® Forum Software