Ms 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 microsoft vbscript compilation error 800a0408 the company Business Learn more about hiring developers or posting ads with us Stack Overflow microsoft vbscript compilation error 800a0400 Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of
Microsoft Vbscript Compilation Error: Expected Statement
6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting : Microsoft VBScript compilation error: Expected ')' up vote 0 down vote favorite I am new to
Vbscript Compilation Error Syntax Error
vb script and want to create a shortcut for my .exe application which will open in an invisible window. Here is the code which I have written Option Explicit Private Sub Command1_Click() 'This will Create a ShortCut of test_application in our desktop, its name is "My-Test", invisible windows when run, use the 2nd icon as the Shortcut icon.' Create_ShortCut "C:\MyApp\bin\test_application.exe", "Desktop", "My-Test", , 0, 1 End Sub Sub Create_ShortCut(ByVal TargetPath As String, ByVal microsoft vbscript compilation error expected end of statement ShortCutPath As String, ByVal ShortCutname As String, Optional ByVal WorkPath As String, Optional ByVal Window_Style As Integer, Optional ByVal IconNum As Integer) Dim VbsObj As Object Set VbsObj = CreateObject("WScript.Shell") Dim MyShortcut As Object ShortCutPath = VbsObj.SpecialFolders(ShortCutPath) Set MyShortcut = VbsObj.CreateShortcut(ShortCutPath & "\" & ShortCutname & ".lnk") MyShortcut.TargetPath = TargetPath MyShortcut.WorkingDirectory = WorkPath MyShortcut.WindowStyle = Window_Style MyShortcut.IconLocation = TargetPath & "," & IconNum MyShortcut.Save End Sub I am stored the script as test.vbs and executed it in the following way C:\Users\me\Desktop>cscript test.vbs and it gave me the following error Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. C:\Users\me\Desktop\test.vbs(9, 38) Microsoft VBScript compilation error: Expected ')' Is this a good way to create a shortcut or is there any better and more verbose way to do it ? vbscript share|improve this question asked Sep 19 '13 at 16:03 msd_2 1941516 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted There are a few problems with your script. In answer to your question, the reason you are receiving an error is because VBScript only supports one data type - Variant. In your function "Create_Shortcut", you are defining your parameters as particular data types, such as "As String and "As Integer". Remove the data type declarations
jokes This Error 800A03EE can be tricky. While it is indeed a syntax error, it may not be where
Microsoft Vbscript Compilation Error Fix
you expect. Therefore, check the Char: Number for the line of microsoft vbscript compilation error '800a0401' this error. Introduction to Code 800A03EE Error code 800A03EE occurs when you execute a VBScript. You receive 1 1 microsoft vbscript compilation error expected statement a message box from Windows Scripting Host. Code 800A03EE means a syntax error, check your punctuation especially the ampersands. The Symptoms You Get The script does not http://stackoverflow.com/questions/18899668/getting-microsoft-vbscript-compilation-error-expected execute as you hoped, instead you get a WSH error message. The Cause of Code 800A03EE Your VBScript contain is missing a argument. Note: The clue, Error: Expected ")'. There is something wrong with a bracket or a speech mark. Source: Microsoft VBScript compilation error, means there is a syntax error in your script, rather than http://www.computerperformance.co.uk/Logon/code/code_800A03EE.htm a logical error with a server or network object. The Solutions The Windows Scripting Host gives us three useful clues, firstly, look on Line: 6, do count any remark or empty lines. Secondly, the Char: number (34), is very useful in tracing the error. In this case there is something wrong at the end of line 6. Thirdly Error: ')' is pointing us to the script problem. Therefore, check the syntax of your script and balance your brackets. ‡ Example 1 of Script Code 800A03EE error Note: The Line: 6 Char 34 strcn It should be strcn) note the closing bracket 'CREATE USER AND SET PASSWORD strcn = "bilbo65" strsam= "bilbo65" strpasswd = sbuline9 Set objOU=GetObject("LDAP://ou=Droitwich,dc=cp,dc=com") objUser = objOU.Create("User", "cn=" & strcn objUser.Put "sAMAccountName","bilbo65" ObjUser.SetInfo objUser.SetPassword strpasswd Corrected Version 'CREATE USER AND SET PASSWORD strcn = "bilbo65" strsam= "bilbo65" strpasswd = sbuline9 Set objOU=GetObject("LDAP://ou=Droitwich,dc=cp,dc=com") objUser = objOU.Create("User", "cn=" & strcn) objUser.Put "sAMAccountName","bilbo65" ObjUser.SetInfo objUser.SetPassword strpasswd © Example 2 - M
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) Executing Commands Unix like http://www.gunnalag.com/2011/04/29/fix-microsoft-vbscript-compilation-error-800a0408-invalid-character/ Head & Tail Implementing detailed logging Mapping a Free Drive Letter Convert https://bytes.com/topic/asp-classic/answers/954267-microsoft-vbscript-compilation-error-800a0400-expected-statement PS script into an Exe Process Explorer Password Generator SQL List 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 Convert UTC Time to Local Time Saving each row from vbscript compilation 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 compilation error 800A0408: Invalid character When you run a newly authored VBScript code that vbscript compilation error 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. My recommendation and much simpler tool is Notepad2 which gives to this option as shown below: Handling it in default Notepad: Share this:EmailPrintLinkedInFacebookTwitterPinterestGooglePocketRedditSkypeLike this:Like Loading... Posted in: Scripting Post navigation Previo+ Ask a Question Need help? Post your question and get tips & solutions from a community of 418,595 IT Pros & Developers. It's quick & easy. Microsoft VBScript compilation error '800a0400' Expected statement P: 1 buri22 I have this error : Microsoft VBScript compilation error '800a0400' Expected statement /amministrazione/add2_sponsor.asp, line 11 <% ^ The code of file "add2_sponsor.asp : Expand|Select|Wrap|Line Numbers <%@LANGUAGE="VBSCRIPT"CODEPAGE="1252"%> <%Session.LCID=1040%>