Microsoft Vbscript Compilation Error Invalid Character Line 1 Column 1
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 microsoft vbscript compilation error 800a0400 about Stack Overflow the company Business Learn more about hiring developers or posting ads
Vbscript Compilation Error Syntax Error
with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow
Microsoft Vbscript Compilation Error: Expected Statement
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
Microsoft Vbscript Compilation Error '800a03ea'
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 = "\\test\public\users\" & strUserName & "\" strRemotePath2 = "\\test\public\groups\" strRemotePath3 = "\\test\scans\" 'Section which maps two drives, M: microsoft vbscript compilation error fix 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 problem in the future, to fix this: Open the .vbs in notepad Go to file and "save as" Right under the file name box, you will see a drop down menu for encoding. Choose ANSI. shar
- 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 The microsoft vbscript compilation error expected end of statement script does not execute as you had hoped. Instead you get a WSH message box like this how to run vbscript 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 word, http://stackoverflow.com/questions/2039104/vbscript-invalid-character-800a0408-compilation-error 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, particularly look http://www.computerperformance.co.uk/Logon/code/code_800A0408.htm 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 sneaked into your script. S
complete with a new "Flat" design, and easy to understand iconography. New Websites We needed websites designed for 2 of our companies, Clinical Research Associates and Touchtone Marketing. City https://community.spiceworks.com/topic/435075-invalid-character-code-error-800a0408-on-all-vbs-scripts of Winston-Salem - Public & Extranet Developed the official City of Winston-Salem website based on DotNetNuke. TECHNOLOGY IN THIS DISCUSSION Join the Community! Creating your account only takes a few minutes. Join Now So I've done https://community.flexerasoftware.com/archive/index.php?t-132466.html 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 try to create vbscript compilation 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 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 vbscript compilation error Chipotle OP Helpful Post AdamRPL 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 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 serror (Err 1720) pheleven04-12-2004, 08:01 AMHi All, I tried to execute a VBS script from the Custom Actions, this script will invoke a batch file to perform the necessary actions, however its giving the following problem: ------------------------------------------------------------ "Error 1720.There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action RegComponents script error -2146827256, Microsoft VBScript compilation error: Invalid character Line 1, Column 1, ÿþS " ------------------------------------------------------------ The VBS scrips is really simple: ------------------------------------------------------------ Dim WshShell Set WshShell = CreateObject("WScript.Shell") WshShell.Run("regcomponent.bat") ------------------------------------------------------------ Can anyone advice what should I do to make this script run? Thanks!! TsungH04-12-2004, 11:47 AMYou would probably want to supply the path to the batch file. pheleven04-13-2004, 10:58 PMHi TsungH, Thanks for the suggestion. I have changed the script by including the fullpath & realised that the error was caused by permission denied when attempting execute script from the [INSTALLDIR], apparently this folder this locked during the installation. I then set the script to be copied into the [TEMPDIR] and execute the custom actions after successful installation, the script worked fine. However, when I used this script to invoke my SQL script (within the tempdir too), the SQL script failed to execute. This SQL script worked fine when tested outside the installer. Any suggestion how can I make the SQL script execution work? Thanks pheleven04-14-2004, 07:29 AMHi, My problem is resolved, just found out that it was the blank space (e.g "C:\Document and Settings\user\Local Settings\temp") that caused to the file not found problem. After moving the scripts to a different location, the VBScript is working perfectly fine now. Thanks.. Powered by vBulletin Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.