Invalid Character Vbscript Compilation 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
Microsoft Vbscript Compilation Error 800a0400
site About Us Learn more about Stack Overflow the company Business Learn more vbscript compilation error syntax error about 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 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why does VBScript microsoft vbscript compilation error '800a03ea' 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 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 microsoft vbscript compilation error fix 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 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, i
- Invalid Character Introduction to Code 800A0408 This error code, 800A0408 occurs when you execute a VBScript. A wild guess a problem with an apostrophe, possibly
Microsoft Vbscript Compilation Error '800a0401'
in a 'REM statement. The Symptoms You Get The script does not microsoft vbscript compilation error expected end of statement execute as you had hoped. Instead you get a WSH message box like this picture: The Cause of
How To Run Vbscript
error 800A0408 Your VBScript contains an illegal character, often at the beginning of a line. It can happen if you copy the script from word, then paste into notepad. For http://stackoverflow.com/questions/13996394/why-does-vbscript-say-invalid-character-when-using-executeglobal-to-import-a example, to 'Rem out a line we need the apostrophe, which is ASCII character 39; however if you paste from word you may get ASCII 96 (Grave accent).Note the clue Source: Microsoft VBScript compilation error, this means a syntax error in your script. The Solutions Check the punctuation marks in your VBScript, particularly look out for apostrophes and commas that do http://www.computerperformance.co.uk/Logon/code/code_800A0408.htm not display correctly. The reference to Line: 1 Char 1, means that the very first symbol that is probably wrong. ‡ Example 1 of error code 800A0408 - Invalid Character Note: The error ‘Rem VBScript It should be ' Rem VBScript ‘ Rem VBScript Set WshShell = WScript.CreateObject("WScript.Shell") Set WshNetwork = WScript.CreateObject("WScript.Network") Set AllDrives = WshNetwork.EnumNetworkDrives() DriveLetter = "N:" 'must be capitalized RemotePath = "\\alan\home" AlreadyConnected = False For i = 0 To AllDrives.Count - 1 Step 2 If AllDrives.Item(i) = DriveLetter Then AlreadyConnected = True Next If AlreadyConnected = False then WShNetwork.MapNetworkDrive DriveLetter, RemotePath WshShell.PopUp "Drive " & DriveLetter & " connected successfully." Else WShNetwork.RemoveNetworkDrive DriveLetter WshShell.PopUp "Drive " & DriveLetter & " disconnected." End if » Example 2 Code 800A0408 - Invalid CharacterI include this screen shot just to emphasise that Char: number need not be one. Thus Char: 20, or what ever your char number is, becomes a big clue in tracing obscure characters that may have sneaked into your script. See More Windows Update Error Codes 8004 Series • Error 800A101A8 Object Required • Error 8
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) http://www.gunnalag.com/2011/04/29/fix-microsoft-vbscript-compilation-error-800a0408-invalid-character/ Executing Commands Unix like Head & Tail Implementing detailed logging Mapping a Free Drive Letter Convert PS script into an Exe Process Explorer Password Generator SQL List http://www.sevenforums.com/general-discussion/364786-line-1-char-110-error-invalid-character-code-800a0408-source-microsoft.html all active connections List all DBs Sizes in MBs List all DB names in Oracle Kill all sessions connected to SQL DB Search a complete SQL DB vbscript compilation 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 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 vbscript compilation error 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: 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. MyAcer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks. Windows 7 Help Forums Windows 7 help and support General Discussion » User Name Remember Me? Password Advanced Search Show Threads Show Posts Advanced Search Go to Page... Windows 7: Line 1 Char 110 Error Invalid character Code 800A0408 Source Microsoft 20 Mar 2015 #1 TeamCrafters2 Windows 8.1 1 posts Line 1 Char 110 Error Invalid character Code 800A0408 Source Microsoft I Got A Error When Opening My File it Says Line 1 Char 110 Error Invalid character Code 800A0408 Source Microsoft VBScript compilation error. Can Someone Help Me? My System Specs Computer type PC/Desktop System Manufacturer/Model Number Gateway OS Windows 8.1 CPU Unknown Motherboard Unknown Memory Unknown Graphics Card Unknown Hard Drives Unknown Antivirus Windows Defender Or AVG Browser Internet Explorer or Google Chrome TeamCrafters2 View Public Profile Find More Posts by TeamCrafters2 . 21 Mar 2015 #2 Irene Windows 7 Home Premium 64bit 3,076 posts Stafford, England A suggestion, which may help, in the following link: Code 800A0408 - Invalid Character error in VBScript My System Specs Computer type PC/Desktop System Manufacturer/Model Number Packard Bell OS Windows 7 Home Premium 64bit CPU Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz Motherboard Packard Bell IPISB-AG Memory 3.00 GB Graphics Card (1) Intel(R) HD Graphics (2) VNC Mirror Driver Sound Card Realtek High Definition Audio Monitor(s) Displays AIO LCD Screen Resolution 1920 x 1080 Keyboard Wireless Mouse Wireless Hard Drives WDC WD10EADX-22TDHB0 ATA Device Fixed hard disk media 4 partitions 931.51 GB Antivirus Microsoft Security Essentials Browser IE; Firefox Other Info Also: Samsung N220 Plus Netbook - Windows 7 Home HP laptop iPad 5 Irene View Public Profile Find More Posts by Irene Line 1 Char 110 Error Invalid character Code 800A0408 Source Microsoft « Previous Thread | Next Thread » Search this Thread Advanced Search Similar help and support threads Thread Forum Folder with invalid character does not open.Hi all, I have encountered an issue where a folder will not open under Windows 7. Selecting the folder does nothing, and right-selecting the folder does not bring up any context menu. I happen to know that there is media content inside the folder. Closer inspection of the folder name gave... General Discussion Can't uninstall stamps.com - invalid character in My DesktopI tried installing the update to stamps.com to version 12, w