How To Fix Microsoft 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 site About Us Learn more about Stack Overflow the company microsoft vbscript compilation error 800a0408 Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Microsoft Vbscript Compilation Error 800a0400
Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, vbscript compilation error syntax error 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 microsoft vbscript compilation error expected statement 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: and P: and S: objNetwork.MapNetworkDrive strDriveLetter1, strRemotePath1 objNetwork.MapNetworkDrive strDriveLetter2, strRemotePath2 objNetwork.MapNetworkDrive strDriveLetter3, strRemotePath3 'Extra code
Microsoft Vbscript Compilation Error '800a0401'
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. share|improve this answer edited Oct 31 '13 at 17:06 answered Feb 9 '12 at 19:59 Ammar Ahmed 7132917 add a comment| up vote 0 down vote Check you are not u
- 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 in a 'REM statement. The Symptoms You Get The microsoft vbscript compilation error '800a03ea' script does not execute as you had hoped. Instead you get a WSH message microsoft vbscript compilation error expected end of statement box like this picture: The Cause of error 800A0408 Your VBScript contains an illegal character, often at the beginning of a line.
Microsoft Vbscript Compilation Error '800a03ee' Expected ')'
It 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 http://stackoverflow.com/questions/2039104/vbscript-invalid-character-800a0408-compilation-error 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 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 - http://www.computerperformance.co.uk/Logon/code/code_800A0408.htm 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 800A0046 • Error 800A10AD • Error 800A000D • Error 80048820 • Error 800A0401 • Review of SolarWinds Permissions Monitor • Error 80040E14 • Error 800A03EA • Error 800A0408 • Error 800A03EE Guy Recommends: WMI Monitor and It's Free! Windows Management Instrumentation (WMI) is one of the hidden treasures of Microsoft operating systems. Fortunately, SolarWinds have created the
by a Fortune 500 verification firm. Get a Professional Answer Via email, text message, or notification as http://www.justanswer.com/computer-programming/2sw05-fix-microsoft-vbscript-compilation-error-windows-system32-regedit-s.html you wait on our site.Ask follow up questions if you need to. 100% Satisfaction Guarantee Rate the answer you receive. Ask NeOh Your Own Question NeOh, Computer Software Engineer Category: Programming Satisfied Customers: 951 Experience: Currently working in web applications.Good Experience in C,VB,ASP,Javascript 15563787 Type Your Programming Question Here... NeOh is online now vbscript compilation How do I fix a microsoft VBScript compilation error windows system32 regedit.s Customer Question How do I fix a microsoft VBScript compilation error\windows\system32\regedit.sysline 3char 44846Unterminated string constant800A0409 Submitted: 6 years ago. Category:Programming Share this conversation Expert: NeOh replied6 years ago. HI,Could you please explain me that when you are getting this error ?ThanksShidhin vbscript compilation error Ask Your Own Programming Question Customer: replied6 years ago. Upon startup. I have to close that window in order to launch anysoftware, get on the internet, or access any files. I also get it periodically when I'm accessing new programs via internet - such as applications that IUse via my server from work. Thank you for your help. Kw Expert: NeOh replied6 years ago. HI,Seems like your system got infected by a virus .. please follow these stepsTry this Spybot search and Desttroy software. Its free , no need to buy.you can download it from this link http://www.safer-networking.org/en/download/index.htmlJust install it ..Now restart your system and keep pressing the F8 key. from this window, goto the safe mode. now open Spybot and start the scanAlso if your task manager is disabled, then do this to enable it back1)Go to start>Run>type "gpedit.Msc" without quotes.2)The group policy editor appears. 3)Double Click on user configuration-->Administrative Templates-->System-->CTRL+ALT+DEL options-->Remove task manager-->Choose the