Microsoft Vbscript Compilation Error 800a0408 Invalid Character
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
Microsoft Vbscript Compilation Error 800a0400
About Us Learn more about Stack Overflow the company Business Learn more about vbscript compilation error syntax error hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Microsoft Vbscript Compilation Error: Expected Statement
Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why does VBScript say microsoft vbscript compilation error '800a03ea' “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 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 microsoft vbscript compilation error fix 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 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 th
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 & Tail Implementing detailed logging Mapping a Free
Microsoft Vbscript Compilation Error '800a0401'
Drive Letter Convert PS script into an Exe Process Explorer Password Generator SQL microsoft vbscript compilation error expected end of statement List all active connections List all DBs Sizes in MBs List all DB names in Oracle Kill all sessions connected to
How To Run Vbscript
SQL DB Search a complete SQL DB Convert UTC Time to Local Time Saving each row from SELECT results set dbo vs. db_owner Others Php - What is my IP Address? ASP - What http://stackoverflow.com/questions/13996394/why-does-vbscript-say-invalid-character-when-using-executeglobal-to-import-a 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, you may possibly receive the “Microsoft VBScript compilation error 800A0408: Invalid character” as shown below. ------------------ Windows Script Host Script: http://www.gunnalag.com/2011/04/29/fix-microsoft-vbscript-compilation-error-800a0408-invalid-character/ 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” Kouta says: September 21, 2011 at 11:40 am Holy Sh*T thanks! i look all webs and nothing about this error very thanks ^^! Reply Anurag says: November 16, 2011 at 4:57 pm THANKS MAN ..just to correct you …simple NOtaccount only takes a few minutes. Join Now So I've done something it seems. I had to edit one of my VBS script the other day and now I get this message each time I try to run it. Every VBS script I https://community.spiceworks.com/topic/435075-invalid-character-code-error-800a0408-on-all-vbs-scripts try to create now I get the same error when I run it. I found some posts talking about it being an issue with ANSI encoding. I tried to encode them all as ANSI which I assumed Notepad++ was doing by http://www.note.id.lv/2012/07/microsoft-vbscript-compilation-error.html default but that has not solved the issue. Reply Subscribe View Best Answer RELATED TOPICS: Remotely execute VBS scripts to all your computers Marrying 2 VBs scripts into 1 VBS Scripts   5 Replies Chipotle OP Helpful Post AdamRPL vbscript compilation Jan 23, 2014 at 5:42 UTC In the command line or a batch file try using "type old.vbs > new.vbs" to convert the file(s) to ansi. http://www.robvanderwoude.com/type.php#Unicode
0 Thai Pepper OP Helpful Post Dave Rossi Jan 23, 2014 at 5:43 UTC You need to post a snippet of your code, maybe the line and character referenced in the error? We do not have enough information to help with just the error. EDIT: After searching the error, it does seen to be vbscript compilation error an encoding issue. I have never seen that with NotePad++. 0 Datil OP MHB Jan 23, 2014 at 6:36 UTC AdamRPL wrote: In the command line or a batch file try using "type old.vbs > new.vbs" to convert the file(s) to ansi. http://www.robvanderwoude.com/type.php#Unicode Tried that and when I run the new file I get the same message. Notepad++ is showing that it is ANSI. 2014-01-23_13_34_55-aur-mhb-ws_-_Remote_Desktop_Connection.png (41.1 KB) 0 Datil OP MHB Jan 23, 2014 at 6:38 UTC Dave Rossi wrote: You need to post a snippet of your code, maybe the line and character referenced in the error? We do not have enough information to help with just the error. EDIT: After searching the error, it does seen to be an encoding issue. I have never seen that with NotePad++. It's always line 1 character 1. Here is the beginning of the code: This script worked just fine until I edited it recently. 0 Datil OP Best Answer MHB Jan 23, 2014 at 7:21 UTC So I had to go through the whole file and replace invalid characters. This is rather frustrating. What I think happened is I edited in Notepad at one point rather than Notepad++. I'll have to change the default editor for vbs files or I'm going to do that again I'm sure of it. 0 This discussion has been inactive for over a year. You may get a better answer to your question bythe "Microsoft VBScript compilation error 800A0408: Invalid character" as shown below.------------------Windows Script Host------------------Line: 1Char: 1Error: Invalid characterCode: 800A0408Source: Microsoft VBScript compilation error------------------------------------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.Very common cause for this error would the File Encoding used by the IDE/Editor software that you used to author/copy this script.To Fix:You need to ensure that your VBScript is encoded in ANSI format for the VBScript compiler to successfully execute your script. /* */ at 11:46 PM Labels: Microsoft , VBScript , Windows Sandbox 0 comments : Post a Comment Comment: Newer Post Older Post Home Subscribe to: Post Comments ( Atom ) Search Loading... Popular posts Windows 7 network tray icon showing wrong status Xerox WorkCentre admin mode. How To Change Kali Linux Screen Resolution On VirtualBox Enable UPNP on OpenWRT Hi. I'm owner of this blog. If you have some questions or ideas, please feel free to contact me. Find me on: LinkedIn | Facebook |