From: jonesy on
I am a newbie to scripts, so please be gentle.

I am trying to run the following script to copy and overwrite a file;

----------------------------------

Const OverwriteExisting = TRUE


Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\TEMP\test.txt" , "C:\temp\test", OverwriteExisting

---------------------------------

Everytime I run it, it comes up with a permission denied for character
1 of the 2nd line of text. Is there something obvious that I am
missing?

From: Al Dunbar on

"jonesy" <stevenjones_6(a)hotmail.com> wrote in message
news:1129586113.552503.224780(a)o13g2000cwo.googlegroups.com...
>I am a newbie to scripts, so please be gentle.
>
> I am trying to run the following script to copy and overwrite a file;
>
> ----------------------------------
>
> Const OverwriteExisting = TRUE
>
>
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> objFSO.CopyFile "C:\TEMP\test.txt" , "C:\temp\test", OverwriteExisting
>
> ---------------------------------
>
> Everytime I run it, it comes up with a permission denied for character
> 1 of the 2nd line of text. Is there something obvious that I am
> missing?

What permissions do you have on the two files in question?

/Al


From: jonesy on
full rights on the file, and the folders.

The thing that I cannot understand is that the message talks about
character 1 of line 5 (2nd body of text). Is there something that I
need to add to the script?

From: ?rjan Johansson on
You're trying to copy the file C:\Temp\test.txt into the directory
C:\Temp\test, right? Then you need to add a backslash:
objFSO.CopyFile "C:\TEMP\test.txt" , "C:\temp\test\", OverwriteExisting

HTH,
?rjan

"Al Dunbar" <AlanNOSPAmDrub(a)hotmail.com> wrote in message
news:uTPiD$30FHA.1108(a)TK2MSFTNGP14.phx.gbl...
>
> "jonesy" <stevenjones_6(a)hotmail.com> wrote in message
> news:1129586113.552503.224780(a)o13g2000cwo.googlegroups.com...
>>I am a newbie to scripts, so please be gentle.
>>
>> I am trying to run the following script to copy and overwrite a file;
>>
>> ----------------------------------
>>
>> Const OverwriteExisting = TRUE
>>
>>
>> Set objFSO = CreateObject("Scripting.FileSystemObject")
>> objFSO.CopyFile "C:\TEMP\test.txt" , "C:\temp\test", OverwriteExisting
>>
>> ---------------------------------
>>
>> Everytime I run it, it comes up with a permission denied for character
>> 1 of the 2nd line of text. Is there something obvious that I am
>> missing?
>
> What permissions do you have on the two files in question?
>
> /Al
>
>


From: Al Dunbar on

"?rjan Johansson" <johanssonorjan(a)gmail.NOSPAM.com> wrote in message
news:_635f.36261$d5.193165(a)newsb.telia.net...
> You're trying to copy the file C:\Temp\test.txt into the directory
> C:\Temp\test, right? Then you need to add a backslash:
> objFSO.CopyFile "C:\TEMP\test.txt" , "C:\temp\test\", OverwriteExisting

Hah! I never thought of that. I assumed he wanted to overwrite a FILE by the
name of TEST with the content of his "test.txt" file.

/Al

> HTH,
> ?rjan
>
> "Al Dunbar" <AlanNOSPAmDrub(a)hotmail.com> wrote in message
> news:uTPiD$30FHA.1108(a)TK2MSFTNGP14.phx.gbl...
>>
>> "jonesy" <stevenjones_6(a)hotmail.com> wrote in message
>> news:1129586113.552503.224780(a)o13g2000cwo.googlegroups.com...
>>>I am a newbie to scripts, so please be gentle.
>>>
>>> I am trying to run the following script to copy and overwrite a file;
>>>
>>> ----------------------------------
>>>
>>> Const OverwriteExisting = TRUE
>>>
>>>
>>> Set objFSO = CreateObject("Scripting.FileSystemObject")
>>> objFSO.CopyFile "C:\TEMP\test.txt" , "C:\temp\test", OverwriteExisting
>>>
>>> ---------------------------------
>>>
>>> Everytime I run it, it comes up with a permission denied for character
>>> 1 of the 2nd line of text. Is there something obvious that I am
>>> missing?
>>
>> What permissions do you have on the two files in question?
>>
>> /Al
>>
>>
>
>


 | 
Pages: 1
Prev: HTA Exit Codes
Next: Registry permissions...