Invalid Character Vbscript Error
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
Microsoft Vbscript Compilation Error Invalid Character 1 1
the company Business Learn more about hiring developers or posting ads with us Stack Overflow microsoft vbscript compilation error 800a0400 Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 vbscript compilation error syntax error million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why does VBScript say “Invalid Character” when using ExecuteGlobal to import a .vbs function library file? up vote 2
Microsoft Vbscript Compilation Error: Expected Statement
down vote favorite 2 I am encountering a "Invalid Character" error in my VBscript! In particular, within this block of code: '******************************************************************* 'Import Code 'by Cheyne Wallace 'November 2008 'When using only VBscript (not QTP), this code will import any function library passed into it. 'Copy this function into a file, then use it to bring in various other function libraries. 'Usage: ' Import "Library.vbs" Sub Import(strFile) Dim objFSO : Set objFSO
Microsoft Vbscript Compilation Error '800a03ea'
= CreateObject("Scripting.FileSystemObject") Dim wss : Set wss = CreateObject("WScript.Shell") strFile = wss.ExpandEnvironmentStrings(strFile) strFile = objFSO.GetAbsolutePathName(strFile) Set objFile = objFSO.OpenTextFile(strFile, 1) ExecuteGlobal objFile.ReadAll objFile.Close : Set objFSO = nothing Set wss = Nothing End Sub The error states "Microsoft VBScript compilation error. Invalid Character. Code: 800A0408" on Char: 2, Line 206 which is the very first letter on ExecuteGlobal objFile.ReadAll (character 1 is a tab). I have typed and retyped the line, as well as the surrounding line breaks. Still, it keeps saying 'Invalid character'. What is going on?? character-encoding vbscript import importerror invalid-characters share|improve this question edited Aug 22 '13 at 0:25 asked Dec 21 '12 at 19:56 Eptin 56931131 add a comment| 2 Answers 2 active oldest votes up vote 4 down vote accepted As it turns out, the problem was not with ExecuteGlobal, but instead with the .vbs file I was attempting to import. The file I was importing was not in ANSI encoding. If VBScript has a problem with the file you are importing, it will report the error at the character and line for the beginning of ExecuteGlobal (which admittedly causes confusion). Open the file you are attempting to import, convert it to ANSI and everything should work. share|improve this answer answered Dec 21 '12 at 19:56 Eptin 56931131 add a com
here for a quick overview of the site Help Center Detailed answers to any questions you might microsoft vbscript compilation error fix have Meta Discuss the workings and policies of this site About
Microsoft Vbscript Compilation Error '800a0401'
Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting microsoft vbscript compilation error expected end of statement ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million http://stackoverflow.com/questions/13996394/why-does-vbscript-say-invalid-character-when-using-executeglobal-to-import-a programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why does VBScript say “Invalid Character” when using ExecuteGlobal to import a .vbs function library file? up vote 2 down vote favorite 2 I am encountering a "Invalid Character" error in my VBscript! In particular, within this block of http://stackoverflow.com/questions/13996394/why-does-vbscript-say-invalid-character-when-using-executeglobal-to-import-a code: '******************************************************************* 'Import Code 'by Cheyne Wallace 'November 2008 'When using only VBscript (not QTP), this code will import any function library passed into it. 'Copy this function into a file, then use it to bring in various other function libraries. 'Usage: ' Import "Library.vbs" Sub Import(strFile) Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject") Dim wss : Set wss = CreateObject("WScript.Shell") strFile = wss.ExpandEnvironmentStrings(strFile) strFile = objFSO.GetAbsolutePathName(strFile) Set objFile = objFSO.OpenTextFile(strFile, 1) ExecuteGlobal objFile.ReadAll objFile.Close : Set objFSO = nothing Set wss = Nothing End Sub The error states "Microsoft VBScript compilation error. Invalid Character. Code: 800A0408" on Char: 2, Line 206 which is the very first letter on ExecuteGlobal objFile.ReadAll (character 1 is a tab). I have typed and retyped the line, as well as the surrounding line breaks. Still, it keeps saying 'Invalid character'. What is going on?? character-encoding vbscript import importerror invalid-characters share|improve this question edited Aug 22 '13 at 0:25 asked Dec 21 '12 at 19:56 Eptin 56931131
XenDesktop 7.x Evaluations SysTools Export Notes Software Testdrive What is Software TestDrive? PowerShell Basic Question and Answers Deleting Files and Folders Copying File/Folder(s) Listing only Files/Folder(s) Executing Commands Unix like Head & http://www.gunnalag.com/2011/04/29/fix-microsoft-vbscript-compilation-error-800a0408-invalid-character/ Tail Implementing detailed logging Mapping a Free Drive Letter Convert PS script into an Exe Process Explorer Password Generator SQL List all active connections List all DBs Sizes in MBs List http://dan.hersam.com/2012/07/09/vbscript-invalid-character-error/ all DB names in Oracle Kill all sessions connected to SQL DB Search a complete SQL DB Convert UTC Time to Local Time Saving each row from SELECT results set vbscript compilation dbo vs. db_owner Others Php - What is my IP Address? ASP - What is my IP Address? Password Generator - Simple String Compiling Perl Modules Fix: Microsoft VBScript compilation error 800A0408: Invalid character gunnalagApril 29, 2011July 9, 2014 Fixing Microsoft VBScript compilation error 800A0408: Invalid character When you run a newly authored VBScript code that you copied from an existing/working script, vbscript compilation error you may possibly receive the “Microsoft VBScript compilation error 800A0408: Invalid character” as shown below. ------------------ Windows Script Host Script: C:TestRunBatch.vbs Line: 1 Char: 1 Error: Invalid character Code: 800A0408 Source: Microsoft VBScript compilation error
------------------ OK ------------------ Analysis: This error usually indicates that there is an invalid character in the script that VBScript compiler can’t understand. Thus it fails with the error. Cause: Very common cause for this error would the File Encoding used by the IDE/Editor software that you used to author/copy this script. Fix: You need to ensure that your VBScript is encoded in ANSI format for the VBScript compiler to successfully execute your script. How to Apply the fix: For the newbie's, they can use any of the latest text editors like Notepad++, Notepad2, etc,. where you have an option to change the File Encoding. My recommendation and much simpler tool is Notepad2 which gives to this option as shown below: Handling it in default Notepad: Share this:EmailPrintLinkedInFacebookTwitterPinterestGooglePocketRedditSkypeLike this:Like Loading... Posted in: Scripting Post navigation PreviousNext 8 thoughts on “Fix: Microsoft VBScript compilation error 800A0408: Invalid character”character Code: 800A0408 Source: Microsoft VBScript compilation errorOr with Cscript: (1, 1) Microsoft VBScript compilation error: Invalid characterRelated PostsHow to Fix a Delay When Opening Files in Microsoft OfficeGoogle Fonts Hurting PageSpeed Score?Easily Create Windows ShortcutsPHP Truncating POST Datanf_conntrack: table full, dropping packetThe Imminent Demise of Windows XP Comments (1)Computers - ProgrammingComments (Post a comment) | Comments RSS feedSETTING IT TO ANSI DOESNT WORK PLZ HALPPP! Comment by FnafWorldFan123 on January 23, 2016 @ 1:50 pmPost a commentName: (required) E-mail: (required) (will never be visible) URL: (optional) Your comments: - home my projects news links other links about me blog archives docs entertainment experiences funny lists humor intellectual interests music opinions photos web designs tools software webmaster helpBecome a Patron Support this siteMost Popular Pages Riddles Brain teasers Trivia Pickup lines Not bright one linersSign upGet an email when I post or subscribe to the newsfeed Search blog archives CalendarJuly 2012SMTWTFS« JunAug »12345678910111213141516171819202122232425262728293031Random quoteThe smallest deed is better than the greatest intention. (See all the quotes) Guest map Say hi on Google+Page loaded in 0.0105 seconds