470,619 Members | 1,960 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,619 developers. It's quick & easy.

FileSystemObject: Permission denied??

Hi,
I got the err below, nevertheless my folders have full permissions for all.

Permission denied
/vilmar/ASP_JavaScript_CSS_HTML/ajudas_asp_completos/novo_asp/novo_asp_4-12-
03/Objeto_FileSystemObject.asp, line 17

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Arquivo = objFSO.CreateTextFile("c:\Texto_teste.txt", True)
Arquivo.WriteLine("Isto é um texto." & vbcrlf & "Outra linha do texto e " &
vbcrlf & "....outra linha do texto.")
Arquivo.Close
Set Arquivo = objFSO.GetFile("c:\Texto_teste.txt")
Arquivo.Move "D:\Testes_Apostilas" ' »»line 17

Thanks,

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC
Jul 19 '05 #1
4 12085

"Vilmar Brazão de Oliveira" <su*****@hitecnet.com.br> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
.. . .
Set Arquivo = objFSO.GetFile("c:\Texto_teste.txt")
Arquivo.Move "D:\Testes_Apostilas" ' »»line 17


To move a File into a Directory, I think that should be

Arquivo.Move "D:\Testes_Apostilas\"

HTH,
Phill W.
Jul 19 '05 #2
IUSR_MachineName is unlikely to have permissions to read/write to c:\ or
d:\, and probably for good reason. Why not create the file in the web
structure, e.g.

Set Arquivo = objFSO.CreateTextFile(Server.MapPath("Texto_teste. txt"), True)

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Vilmar Brazão de Oliveira" <su*****@hitecnet.com.br> wrote in message
news:##**************@TK2MSFTNGP10.phx.gbl...
Hi,
I got the err below, nevertheless my folders have full permissions for all.
Permission denied
/vilmar/ASP_JavaScript_CSS_HTML/ajudas_asp_completos/novo_asp/novo_asp_4-12- 03/Objeto_FileSystemObject.asp, line 17

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Arquivo = objFSO.CreateTextFile("c:\Texto_teste.txt", True)
Arquivo.WriteLine("Isto é um texto." & vbcrlf & "Outra linha do texto e " & vbcrlf & "....outra linha do texto.")
Arquivo.Close
Set Arquivo = objFSO.GetFile("c:\Texto_teste.txt")
Arquivo.Move "D:\Testes_Apostilas" ' »»line 17

Thanks,

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC

Jul 19 '05 #3
> Arquivo.Move "D:\Testes_Apostilas" ' »»line 17

In addition to my other comment, I believe you need a source and a
destination with the Move command. I also have always used FSO for this,
rather than grabbing an additionl file handle.

objFSO.movefile "c:\Texto_teste.txt", "d:\Testes_Apostilas\Texto_teste.txt"

However, as I stated before, why are you putting these things on the roots
of hard-coded drives? And why create and then move... why not just create
it where you want it?

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #4
Thank you Phill and others,
I had forgot the inverted bar \ »» Arquivo.Move "D:\Testes_Apostilas\"

Regards,
Vilmar
Brazil

"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> escreveu na mensagem
news:br**********@yarrow.open.ac.uk...

"Vilmar Brazão de Oliveira" <su*****@hitecnet.com.br> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
. . .
Set Arquivo = objFSO.GetFile("c:\Texto_teste.txt")
Arquivo.Move "D:\Testes_Apostilas" ' »»line 17


To move a File into a Directory, I think that should be

Arquivo.Move "D:\Testes_Apostilas\"

HTH,
Phill W.

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by private.anders | last post: by
reply views Thread by private.anders | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.