Error 70: Access denied 
Author Message
 Error 70: Access denied

Hi there,

I try to move a file from one destination to c:\ on a 98 System. I get the
error 70 (I think, translated: access denied). The command is quite simple.
Solution?

FileSyst.MoveFile DateiName, "C:\"

x------------
All my code, stripped down:

Option Explicit
Dim DateiName, FileSyst, Pfad, tDatei
Set FileSyst = WScript.CreateObject("scripting.filesystemobject")
'Pfad ermitteln
Pfad = FileSyst.GetParentFolderName(WScript.ScriptFullName)

DateiName = FileSyst.BuildPath(Pfad, "Text1.xxx")

TextDatei_Erstellen
Datei_Verschieben

Sub TextDatei_Erstellen()
    Dim Msg, Antw
    If FileSyst.FileExists(DateiName) = True Then
        Msg = "The file exists already" & vbCrlf _
            & "Shall I overwrite it?"
        Antw = MsgBox(Msg, vbYesno + vbQuestion + vbDefaultbutton2,
"Question")
        If Antw = vbNo Then WScript.Quit
    End If
    Set tDatei = FileSyst.CreateTextFile(DateiName, True, False)
End Sub

Sub Datei_Verschieben()
 Dim DateiName1
 Dim Pfad1
 Pfad1="c:\"
 DateiName1 = FileSyst.BuildPath(Pfad1, "Text1.xxx")

 If FileSyst.FileExists(DateiName1) = True Then
        Msg = "Destination file exists already" & vbCrlf _
            & "Shall I stop now?"
        Antw = MsgBox(Msg, vbYesno + vbQuestion + vbDefaultbutton2,
"Question")
        If Antw = vbNo Then WScript.Quit

    End If

 On Error Resume Next
 FileSyst.MoveFile DateiName, "C:\"
    If err.Number <> 0 Then
       msgbox Err.Number & vbCrlf & err.Description
    End If

End Sub



Thu, 05 Jun 2003 16:25:27 GMT  
 Error 70: Access denied
Sounds like a permissions problem to me.  Does the IUSR have RWXD privileges
on the root of your c: drive?
Quote:

>Hi there,

>I try to move a file from one destination to c:\ on a 98 System. I get the
>error 70 (I think, translated: access denied). The command is quite simple.
>Solution?

>FileSyst.MoveFile DateiName, "C:\"

>x------------
>All my code, stripped down:

>Option Explicit
>Dim DateiName, FileSyst, Pfad, tDatei
>Set FileSyst = WScript.CreateObject("scripting.filesystemobject")
>'Pfad ermitteln
>Pfad = FileSyst.GetParentFolderName(WScript.ScriptFullName)

>DateiName = FileSyst.BuildPath(Pfad, "Text1.xxx")

>TextDatei_Erstellen
>Datei_Verschieben

>Sub TextDatei_Erstellen()
>    Dim Msg, Antw
>    If FileSyst.FileExists(DateiName) = True Then
>        Msg = "The file exists already" & vbCrlf _
>            & "Shall I overwrite it?"
>        Antw = MsgBox(Msg, vbYesno + vbQuestion + vbDefaultbutton2,
>"Question")
>        If Antw = vbNo Then WScript.Quit
>    End If
>    Set tDatei = FileSyst.CreateTextFile(DateiName, True, False)
>End Sub

>Sub Datei_Verschieben()
> Dim DateiName1
> Dim Pfad1
> Pfad1="c:\"
> DateiName1 = FileSyst.BuildPath(Pfad1, "Text1.xxx")

> If FileSyst.FileExists(DateiName1) = True Then
>        Msg = "Destination file exists already" & vbCrlf _
>            & "Shall I stop now?"
>        Antw = MsgBox(Msg, vbYesno + vbQuestion + vbDefaultbutton2,
>"Question")
>        If Antw = vbNo Then WScript.Quit

>    End If

> On Error Resume Next
> FileSyst.MoveFile DateiName, "C:\"
>    If err.Number <> 0 Then
>       msgbox Err.Number & vbCrlf & err.Description
>    End If

>End Sub



Fri, 06 Jun 2003 21:13:33 GMT  
 Error 70: Access denied
Check the attributes on the file you are overwriting.  If it is read-only you
will get an error 70.  I haven't found a way around it except for deleting the
destination and then copying/moving over.

-doug

Quote:
-----Original Message-----

Hi there,

I try to move a file from one destination to c:\ on a 98 System. I get the
error 70 (I think, translated: access denied). The command is quite simple.
Solution?

FileSyst.MoveFile DateiName, "C:\"

x------------
All my code, stripped down:

Option Explicit
Dim DateiName, FileSyst, Pfad, tDatei
Set FileSyst = WScript.CreateObject("scripting.filesystemobject")
'Pfad ermitteln
Pfad = FileSyst.GetParentFolderName(WScript.ScriptFullName)

DateiName = FileSyst.BuildPath(Pfad, "Text1.xxx")

TextDatei_Erstellen
Datei_Verschieben

Sub TextDatei_Erstellen()
    Dim Msg, Antw
    If FileSyst.FileExists(DateiName) = True Then
        Msg = "The file exists already" & vbCrlf _
            & "Shall I overwrite it?"
        Antw = MsgBox(Msg, vbYesno + vbQuestion + vbDefaultbutton2,
"Question")
        If Antw = vbNo Then WScript.Quit
    End If
    Set tDatei = FileSyst.CreateTextFile(DateiName, True, False)
End Sub

Sub Datei_Verschieben()
 Dim DateiName1
 Dim Pfad1
 Pfad1="c:\"
 DateiName1 = FileSyst.BuildPath(Pfad1, "Text1.xxx")

 If FileSyst.FileExists(DateiName1) = True Then
        Msg = "Destination file exists already" & vbCrlf _
            & "Shall I stop now?"
        Antw = MsgBox(Msg, vbYesno + vbQuestion + vbDefaultbutton2,
"Question")
        If Antw = vbNo Then WScript.Quit

    End If

 On Error Resume Next
 FileSyst.MoveFile DateiName, "C:\"
    If err.Number <> 0 Then
       msgbox Err.Number & vbCrlf & err.Description
    End If

End Sub

.



Wed, 18 Jun 2003 06:22:56 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CreateObject("Anything.Application") Error 70 (Access denied)

2. Error Number : 70 and Error Description : Permission Denied

3. Compile Error - Permission Denied (Error 70)

4. How to avoid error 70: permission denied?

5. error 70: permission denied for MsgBox

6. Permission Denied (Error 70)

7. winNT: run-time error 70, permission denied ?

8. VB4 & Acc 2 - Error 70 Permission Denied

9. Error 70: Permission Denied (over network)

10. Shell error 70 permission denied

11. runtime error 70 Permission denied:

12. Runtime error '70' Permission denied

 

 
Powered by phpBB® Forum Software