Microsoft Vbscript Compilation Error Invalid Character
Contents |
here for a quick overview of the site Help Center Detailed answers microsoft vbscript compilation error 800a0400 to any questions you might have Meta Discuss the workings
Vbscript Compilation Error Syntax Error
and policies of this site About Us Learn more about Stack Overflow the company Business microsoft vbscript compilation error: expected statement Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack microsoft vbscript compilation error fix 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 VBScript Invalid Character 800A0408 compilation error up vote 16 down vote favorite 2 I get a compilation error when I try to run the following
Microsoft Vbscript Compilation Error '800a03ea'
vbs code from a command prompt in Windows 7. Option Explicit Dim objNetwork, strRemotePath1, strRemotePath2, strRemotePath3 Dim strDriveLetter1, strDriveLetter2, strDriveLetter3, strUserName Set objNetwork = CreateObject("WScript.Network") strUserName = objNetwork.UserName strDriveLetter1 = "H:" strDriveLetter2 = "P:" strDriveLetter3 = "S:" strRemotePath1 = "\\test\public\users\" & strUserName & "\" strRemotePath2 = "\\test\public\groups\" strRemotePath3 = "\\test\scans\" 'Section which maps two drives, M: and P: and S: objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1 objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2 objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3 'Extra code just to add a message box WScript.Echo "Map drives " & strDriveLetter1 & " & " & strDriveLetter2 & " & " & strDriveLetter3 Wscript.Quit It says the issue is with Line 1 Char 1. Any ideas? vbscript share|improve this question asked Jan 10 '10 at 23:27 Mike 1,33462447 15 have you saved your .vbs file as ANSI? –Rubens Farias Jan 10 '10 at 23:29 That was it. Thanks! –Mike Jan 10 '10 at 23
- Invalid Character Introduction to Code 800A0408 This error code, 800A0408 occurs when you execute a VBScript. A wild guess a problem with microsoft vbscript compilation error '800a0401' an apostrophe, possibly in a 'REM statement. The Symptoms You Get microsoft vbscript compilation error expected end of statement The script does not execute as you had hoped. Instead you get a WSH message box like
How To Run Vbscript
this picture: The Cause of error 800A0408 Your VBScript contains an illegal character, often at the beginning of a line. It can happen if you copy the script from http://stackoverflow.com/questions/2039104/vbscript-invalid-character-800a0408-compilation-error word, then paste into notepad. For 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, http://www.computerperformance.co.uk/Logon/code/code_800A0408.htm particularly look out for apostrophes and commas that do 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 sneak
compilation error at Line 1 Char 1" while running a vbscript file which contains following code (this is just a sample code). Option Explicit Dim strUser strUser = "Morgan" WScript.Echo "Hello ! " & strUser Wscript.Quit I have received below error: Script: C:\Test.vbs Line: 1 http://www.morgantechspace.com/2015/07/vbscript-invalid-character-800a0408.html Char: 1 Error: Invalid character Code: 800A0408 Source: Microsoft VBScript compilation error Fix/Solution: This issue was occurs due to the Encoding method UTF-8 which I used to save the .vbs file. We should use the Encoding method http://www.sevenforums.com/general-discussion/364786-line-1-char-110-error-invalid-character-code-800a0408-source-microsoft.html ANSI to save .vbs file. Follow the below steps to fix this issue: 1. Open the vbscript file in Notepad 2. Go to File and click "Save as" 3. Under the vbscript compilation file name, you will see a drop down menu for Encoding. Choose ANSI. 4. Save the file. Recent Posts Oops! Make sure JavaScript is enabled in your browser. Advertisements Advertisements Posted by Morgan at 06:22 Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: VBScript No comments: Post a Comment Newer Post Older Post Home Subscribe to: Post Comments (Atom) Popular Posts Powershell: Set AD Users Password Never Expires flag Create Bulk vbscript compilation error AD Users from CSV using Powershell Script Export AD Users to CSV using Powershell Script samAccountName vs userPrincipalName HTTP Error 503. The service is unavailable. Powershell : Check if AD User is Member of a Group Powershell - Get AD Users Password Expiry Date Create AD User using Powershell Script Get current Date time in JQuery Authenticated Users vs Domain Users Keywords Account Lockout Analyzer Active Directory Active Directory Report AD Attribute AD Audit AD Management AD Permission ASP.NET ASPX Audit Policy Azure AD BIOS C# Command Prompt Cryptographic CSOM CSS CSV Database Desktop Development DNS Endpoint Secutiy Event ID Exchange Online Exchange Server File Access Auditing File System FIPS Compliance Firewall GPO Graph API Html HTTP Error IIS Indexing IP Address JavaScript JQuery LAN Ldap LDAP Filters Logon Audit Logon Type Mailbox Message Tracking MMC MS Access Name Resolution Network Network Shares News NTFS NTFS Persmission Nuget ODBC Office 2016 Office 365 Office 365 Groups Office 365 License Office Dev PnP OLEDB Outlook Package Manager Password Policy PC Powershell Powershell Remoting Powershell Tips Proxy Registry Remote Administration Remote Desktop (RDP) Schedule Task Security Server Server Manager Services SharePoint SharePoint 2013 SharePoint Online Shortcut SQL Database SQL Server SQLQuery SSMS System Administration Task Scheduler TCP TFS User Logon VBScript Visual Studio WEB SERVER WebService WIn32_API Windows Form Windows Service WMI Wo
Acer, 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,