Microsoft Vbscript Compilation Error 800a0408
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 microsoft vbscript compilation error 800a0400 this site About Us Learn more about Stack Overflow the company Business Learn
Vbscript Compilation Error Syntax Error
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
Microsoft Vbscript Compilation Error: Expected Statement
x Dismiss 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
Microsoft Vbscript Compilation Error '800a03ea'
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 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 = microsoft vbscript compilation error fix "\\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:36 add a comment| 3 Answers 3 active oldest votes up vote 45 down vote accepted A possible problem is how your file was encoded; try to save it as ANSI and run it again. share|improve this answer answered Jan 10 '10 at 23:34 Rubens Farias 41.7k289133 that was it for me, thanks! –Dr. Gianluigi Zane Zanettini Mar 1 '15 at 18:37 add a comment| up vote 16 down vote FYI for those with the same pro
- Invalid Character Introduction to Code 800A0408 This error code, 800A0408 occurs when you execute a VBScript. A microsoft vbscript compilation error '800a0401' wild guess a problem with an apostrophe, possibly in a 'REM microsoft vbscript compilation error expected end of statement statement. The Symptoms You Get The script does not execute as you had hoped. Instead you how to run vbscript get a WSH message box like this picture: The Cause of error 800A0408 Your VBScript contains an illegal character, often at the beginning of a line. It http://stackoverflow.com/questions/2039104/vbscript-invalid-character-800a0408-compilation-error can happen if you copy the script from 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 http://www.computerperformance.co.uk/Logon/code/code_800A0408.htm error in your script. The Solutions Check the punctuation marks in your VBScript, 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 n
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 http://www.morgantechspace.com/2015/07/vbscript-invalid-character-800a0408.html error: Script: C:\Test.vbs Line: 1 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 ANSI to save .vbs file. Follow the below steps to fix this issue: 1. Open the vbscript file in Notepad 2. Go to vbscript compilation File and click "Save as" 3. Under the 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: vbscript compilation error Post Comments (Atom) Popular Posts Powershell: Set AD Users Password Never Expires flag Create Bulk 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 20