Error 800a0034 Bad File Name Or Number
Contents |
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 bad filename or number vba about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users
Bad Filename Or Number Access
Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping bad filename or number access import each other. Join them; it only takes a minute: Sign up VBScript runtime error '800a0034' - Bad file name or number - When trying to write to server side text file up vote 1 down vote favorite I'm runtime error 52 bad filename or number fix trying to simply write to a text file for later use data collected from input elements on various pages. Admittedly I am likely missing the obvious, but of the variations I have tried and even some of the sample code I have found in many examples I always get the same error. Code: <% Dim currentDirectoryPath, outFile, objFSO, objTextStream Const fsoForWriting = 2 'Get and assign current directory path currentDirectoryPath = Server.MapPath(".") 'Assign file name to be
Runtime Error 52 Fix
used outFile = "\accdata.txt\" Set objFSO = Server.CreateObject("Scripting.FileSystemObject") 'Open the text file Set objTextStream = objFSO.OpenTextFile(currentDirectoryPath & outFile, fsoForWriting, True) 'Write new line to text file objTextStream.WriteLine "output this as one line of text" 'Close the file and clean up objTextStream.Close Set objTextStream = Nothing Set objFSO = Nothing %> Result: Microsoft VBScript runtime error '800a0034' Bad file name or number /asp/accounting/datacollect.asp, line 23 (Line 23 of the code is:) Set objTextStream = objFSO.OpenTextFile(currentDirectoryPath & outFile, fsoForWriting, True) This is far from being my first language and thus I don't posses a heap load of experience with it so any help or suggestions will be very much appreciated. asp.net vbscript share|improve this question edited Jan 25 '13 at 23:39 Mark Leighton Fisher 4,4172721 asked Jan 25 '13 at 22:32 Clay 33210 1 If this is VB.NET then you should be using the .NET FileStream class. If this is classic ASP then fix your tags. –Sam Axe Jan 25 '13 at 22:55 1 and why does your file name end in a backslash? –Mark Schultheiss Jan 25 '13 at 23:04 Hi Mark.. An earlier problem I encountered was: "Microsoft VBScript runtime error '800a0046' - Permission denied". The solution I found to this was to terminate the file name with a backslash. –Clay Jan 26 '13 at 13:51 Ah Ha !! Thank you
(עברית)المملكة العربية السعودية (العربية)ไทย (ไทย)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語) HomeLibraryLearnDownloadsRepositoryCommunityForumsBlog Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: Invalid file name characters in VBScript Scripting > The Official Scripting Guys Forum! Question 0 Sign in to vote I am trying access 2010 bad filename or number to work with some files on my computer(VistaHomePremium32-bit) using FileSystemObject in VBScript, and getting runtime error 52 excel macro numerous "bad file name or number" runtime errors. Apparently the FSO is much more picky about file name characters than Windows generally.
Bad Filename Or Number Vbscript
Looks like I must write a command-line filter/preprocessor, however I have been unable to find any documentation on exactly which characters are acceptable to FSO. If such exists, I would be grateful for a pointer. http://stackoverflow.com/questions/14531409/vbscript-runtime-error-800a0034-bad-file-name-or-number-when-trying-to-wri Sunday, December 13, 2009 4:52 PM Reply | Quote Answers 0 Sign in to vote Open the file as Unicode and there should be no problem ... Unicode = True Create = True iomode = 1 ' ForReading set infile = fso.OpenTextFile( filename, iomode, Create, Unicode)Tom Lavedas Marked as answer by IamMredMicrosoft employee, Owner Monday, January 11, 2010 6:24 AM Monday, December 14, 2009 4:03 PM Reply https://social.technet.microsoft.com/Forums/scriptcenter/en-US/4d4a01a4-9188-4af7-961c-91657ebd6bbe/invalid-file-name-characters-in-vbscript?forum=ITCG | Quote Moderator All replies 0 Sign in to vote It's better if you can provide more details of the error and also the code snippest . ----------------- Shantanu Sunday, December 13, 2009 5:29 PM Reply | Quote 0 Sign in to vote The only code involved is an attempt to open a file, i.e. "Set objFile = FSO.OpenTextFile(strFileSpec,forReading). The errors are VBScript runtime error 800a0034 "Bad file name or number". The strFileSpec strings come from a text file produced by an invokation of the command-line "dir" command earlier in the script. The errors occur whenever there are uncommon characters in the file name, such as copywrite-symbol, trademark-symbol, bullet(raised dot), letters with umlauts, etc.. As far as I know, these are all valid filename characters (at least in my version of Windows). I've just been looking at the text file produced by "dir" (which is ordinarily deleted by my script when it is finished using it), and it seems that "dir" may not be writing the actual (unicode) file names, and so I can't use those strings to access the file. Bah! Monday, December 14, 2009 3:09 PM Reply | Quote 0 Sign in to vote Open the file as Unicode and there should be no problem ... Unicode = T
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help https://www.experts-exchange.com/questions/21937869/Urgent-Microsoft-VBScript-runtime-error-'800a0034'-error-Please-help.html Ask a Question Ask for Help Receive Real-Time Help Create http://www.visualbasicscript.com/Copyfile-Bad-file-name-or-number-help-m53910.aspx a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Urgent -Microsoft bad file VBScript runtime error '800a0034' error - Please help Want to Advertise Here? Solved Urgent -Microsoft VBScript runtime error '800a0034' error - Please help Posted on 2006-07-31 ASP 1 Verified Solution 18 Comments 3,060 Views Last Modified: 2012-06-22 Hi, I am gettig the following error. Please help Microsoft VBScript runtime name or number error '800a0034' Bad file name or number /ps/esummary/es_online/ES1.asp, line 102 Code: <% '----------------------------- 'File Creation '----------------------------- If Session("submitted") = true then Filename = ("\\daweb\dofa\Dev2\esummary\output\") & Session("randomFileName") Set fso = CreateObject("Scripting.FIleSystemObject") Set f = fso.OpenTextFile(FileName,ForWriting,True) ------ Error %> Below code is what sending the email as an attachment and that file was try to open in the above code: Set objMessage = Server.CreateObject("CDO.Message") 'new Set objConfiguration = Server.CreateObject("CDO.Configuration") 'new Set colFields = objConfiguration.Fields With colFields .Item(cdoSendUsingMethod) = cdoSendUsingPort 'this is a smart host .Item(cdoSMTPServer) = "daismtp.daweb.gov.state.ks.us" 'Mail Server IP address .Item(cdoSendUserName) = "" .Item(cdoSendPassword) = "" .Item(cdoSMTPAuthenticate) = cdoBasic 'other values: cdoAnomymous (default), cdoNTLM .Item(cdoSMTPConnectionTimeout) = 120 'timeout = 30 seconds --> changed to 2 minutes .Item(cdoSMTPServerPort) = 25 .Update End With With objMessage Set .Configur
Posts : 3 Scores: 0 Reward points : 0 Joined: 11/29/2007 Status: offline Copyfile - Bad file name or number - help! Friday, November 30, 2007 1:02 AM (permalink) 0 Hi iv been banging my head with this one, just cant understand why im getting this error message.Im trying to run a copyfile from and im using MID and variables to isolate the reult i want, but when i run the script the copyfile is giving me an error. i using MSGBOX to echo the total results but cant find the problem. this is the script. .. the lines that are commented out are my testing. ********************************* Dim oWsh, oFso, sCurrDir, sHomeDrive, sHomePath, oProcEnv Dim sPCName, sSite, pathx, pathy, sCC, sNetStart Const sSESSIONPATH = "C:\test" Const sSESSFILE = "*.doc" Set oWsh = CreateObject("WScript.Shell") Set oFso = CreateObject("Scripting.FileSystemObject") sCurrDir = GetCurrentDir() sPCName = oWsh.ExpandEnvironmentStrings("%COMPUTERNAME%") sSite = Mid(sPCName, Instr(sPCName, "-") + 1, InstrRev(sPCName, "-") - Instr(sPCName, "-") - 1) sCC = Mid(sPCName, 1,2) ' MsgBox sSite ' MsgBox sCC pathx = sCurrDir & sSite & "\" & sCC & "\" & sSESSFILE MsgBox pathx oFso.CopyFile pathx, sSESSIONPATH, True ' oFso.CopyFile sCurrDir & sSite & "\" & sCC & "\" & sSESSFILE, sSESSIONPATH, True '***************************** the error message im getting is : Microsoft VBScript runtime error: Bad file name or number Thanks in advance. #1 mikeock Total Posts : 124 Scores: 1 Reward points : 0 Joined: 6/8/2006 Status: offline RE: Copyfile - Bad file name or number - help! Friday, November 30, 2007 4:37 AM (permalink) 0 Well i try to run this and get an error on: sCurrDir = GetCurrentDir() is this complete code? It looks like this is calling a subroutine that was not included in this post. My sig sucks! #2 SamP Total Posts : 3 Sc