Createobject Scripting.filesystemobject Error 500
Contents |
this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click 800a0046 permission_denied the register link above to proceed. To start viewing messages, select the forum microsoft vbscript runtime error '800a0046' permission denied 'createobject' that you want to visit from the selection below. Results 1 to 4 of 4 Thread: [RESOLVED] Error 500 microsoft vbscript runtime error 800a0046 permission denied windows 7 when writing to file Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 07-01-2011,05:25 PM #1
Asp Createtextfile Permission Denied
lkeeney View Profile View Forum Posts Visit Homepage Registered User Join Date Mar 2004 Location Nevada, USA Posts 242 [RESOLVED] Error 500 when writing to file First let me say, I am completely new to ASP. I am trying to learn how to write to a file, but I keep getting a "500 Internal Server Error. There is a problem with the resource you microsoft vbscript runtime error '800a0046' permission denied createtextfile are looking for, and it cannot be displayed." message when running the following code: Code: <% dim fs,f,strMessage set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.CreateTextFile("../ASP/test.txt",true) f.write("Hello World!") f.close set f=nothing set fs=nothing %> I have commented out a lot of the code to narrow down the problem, and it appears the error is in the set code. Code: set f=fs.CreateTextFile("../ASP/test.txt",true) I have also tried these adresses: ..\ASP\test.txt ../ASP/test.txt ASP/test.txt ASP\test.txt test.txt I have a folder called ASP which is located in the root file of the website. Within this folder I have a file called test.asp which is the file that contains the above code. I want to generate and write the file "test.txt" in that same folder. I have even provided the absolute address for the test.asp file, and that did not work either. What am I doing wrong? Last edited by lkeeney; 07-01-2011 at 06:00 PM. Larry Reply With Quote 07-02-2011,05:11 AM #2 Ribeyed View Profile View Forum Posts Registered User Join Date Jan 2003 Location Dundee, Scotland Posts 1,367 Hi, Firstly it just seems like you don't have your path correct but ou should wrap your code
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers iis permissions or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x
Iis_iusrs
Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting permission denied error when trying to create file for writing in VBScript up vote 0 down vote favorite I keep getting permission denied when trying to open the second file here for writing. http://www.webdeveloper.com/forum/showthread.php?248315-RESOLVED-Error-500-when-writing-to-file I know the first file opens fine as I can write it out to the screen and I have set write permissions for users. Is this so simple that I'm being blinded by it??? css_org = server.MapPath("style.css") css_new = server.MapPath("new_style.css") Set fso = CreateObject("Scripting.FileSystemObject") Const ForReading = 1 Const ForWriting = 2 Set objFile1 = fso.OpenTextFile (css_org, ForReading) Set objFile2 = fso.OpenTextFile (css_new, ForWriting, True) ' 500 error on this line asp-classic vbscript share|improve this question edited Sep 18 '13 http://stackoverflow.com/questions/18877946/getting-permission-denied-error-when-trying-to-create-file-for-writing-in-vbscri at 17:20 Ansgar Wiechers 85.2k1162102 asked Sep 18 '13 at 16:50 Megan Schilling 1 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote Your code seems to be ASP, so you need to grant write permission to the user running the code (usually the service account running IIS), not the user who is logged into your web application. share|improve this answer answered Sep 18 '13 at 17:17 Ansgar Wiechers 85.2k1162102 I don't understand that? It's on the web so the user could be anyone. The file running the code has permission 777. –Megan Schilling Sep 18 '13 at 17:36 That doesn't make sense. 777 are Unix/Linux permissions. Your code is ASP code, which does not run on Unix/Linux servers. Please update your question with more information about your environment, how the code is supposed to be run, and by whom. –Ansgar Wiechers Sep 18 '13 at 18:09 Sorry for any confusion. 777 is what I see when changing them using FileZilla. On the server they are just plain old Read, Write, etc. Turns out that this wasn't a code issue. The ISP reset the server and it works again. Thanks for trying to help me though. –Megan Schilling Sep 18 '13 at 18:15 1 You can't change permissions on IIS through an FTP programme the way you can on a UNIX server. They'll always show as
360 games PC games https://support.microsoft.com/en-us/kb/197964 Windows games Windows phone games Entertainment All Entertainment Movies & TV Music Business & Education Business Students & educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet permission denied Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All microsoft vbscript runtime Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft