![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Error Why do I get this error on line 5; Object required (WScript) - Arguments But the script runs ok, no errors. Only get this error when I debug with Web_Ed editor. 'This script will Enable User Account Control Dim WshShell, ObjShell, Message Line 5 here > If WScript.Arguments.length = 0 Then Set ObjShell = CreateObject("Shell.Application") ObjShell.ShellExecute "wscript.exe", """" & _ WScript.ScriptFullName & """" & " uac","", "runas", 1 Else Message = "This script will Enable User Account Control." & vbCr & vbCr _ & "After you Run this script, you must Reboot for this to take effect." & vbCr & vbCr _ & "Adding information can unintentionally change or delete values and cause components to stop working correctly." _ & " If you do not trust the source of this information, do not add it to the registry." & vbCr & vbCr _ & "Would you like to continue?" Set WshShell = WScript.CreateObject("WScript.Shell") M = MsgBox(Message, vbYesNo + vbInformation, "Tweaks") If M = 6 Then WshShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA", 1, "REG_DWORD" Message = "UAC is now ENABLED!" & vbCr & vbCr _ & "You must Reboot for this change to take effect." MsgBox Message, 64, "Tweaks" End If End If |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Error "PaulM" <NONO@xxxxxx> wrote in message news:%23Tkq2uLTJHA.5344@xxxxxx Quote: > Why do I get this error on line 5; Object required (WScript) - Arguments > But the script runs ok, no errors. > Only get this error when I debug with Web_Ed editor. > > 'This script will Enable User Account Control > > Dim WshShell, ObjShell, Message > > Line 5 here > If WScript.Arguments.length = 0 Then > Set ObjShell = CreateObject("Shell.Application") > ObjShell.ShellExecute "wscript.exe", """" & _ > WScript.ScriptFullName & """" & " uac","", "runas", 1 > Else > Message = "This script will Enable User Account Control." & vbCr & vbCr _ > & "After you Run this script, you must Reboot for this to take effect." & > vbCr & vbCr _ > & "Adding information can unintentionally change or delete values and > cause components to stop working correctly." _ > & " If you do not trust the source of this information, do not add it to > the registry." & vbCr & vbCr _ > & "Would you like to continue?" > > Set WshShell = WScript.CreateObject("WScript.Shell") > > M = MsgBox(Message, vbYesNo + vbInformation, "Tweaks") > If M = 6 Then > > WshShell.RegWrite > "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA", > 1, "REG_DWORD" > > Message = "UAC is now ENABLED!" & vbCr & vbCr _ > & "You must Reboot for this change to take effect." > MsgBox Message, 64, "Tweaks" > End If > End If |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Error "PaulM" <NONO@xxxxxx> wrote in message news:%23Tkq2uLTJHA.5344@xxxxxx Quote: > Why do I get this error on line 5; Object required (WScript) - Arguments > But the script runs ok, no errors. > Only get this error when I debug with Web_Ed editor. > > 'This script will Enable User Account Control > > Dim WshShell, ObjShell, Message > > Line 5 here > If WScript.Arguments.length = 0 Then > Set ObjShell = CreateObject("Shell.Application") > ObjShell.ShellExecute "wscript.exe", """" & _ > WScript.ScriptFullName & """" & " uac","", "runas", 1 > Else > Message = "This script will Enable User Account Control." & vbCr & vbCr _ > & "After you Run this script, you must Reboot for this to take effect." & > vbCr & vbCr _ > & "Adding information can unintentionally change or delete values and > cause components to stop working correctly." _ > & " If you do not trust the source of this information, do not add it to > the registry." & vbCr & vbCr _ > & "Would you like to continue?" > > Set WshShell = WScript.CreateObject("WScript.Shell") > > M = MsgBox(Message, vbYesNo + vbInformation, "Tweaks") > If M = 6 Then > > WshShell.RegWrite > "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA", > 1, "REG_DWORD" > > Message = "UAC is now ENABLED!" & vbCr & vbCr _ > & "You must Reboot for this change to take effect." > MsgBox Message, 64, "Tweaks" > End If > End If Wscript.Arguments. However, possibly the Wscript object is not available to Web_Ed editor. This object is provided by the wscript (or cscript) host program. The script must be launched by one of these host programs, or the Wscript objects and methods are not available (like Wscript.Sleep for example). -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Error Right here: Line 1.> 'This script will Enable User Account Control Line 2.> Line 3.> Dim WshShell, ObjShell, Message Line 4.> Line 5 here > If WScript.Arguments.length = 0 Then Line 6.>Set ObjShell = CreateObject("Shell.Application") Line 7.> ObjShell.ShellExecute "wscript.exe", """" & _ Line 8.> WScript.ScriptFullName & """" & " uac","", "runas", 1 Line 9.> Else And so on. "Pegasus (MVP)" <I.can@xxxxxx> wrote in message news:#tRsG4LTJHA.4680@xxxxxx Quote: > > "PaulM" <NONO@xxxxxx> wrote in message > news:%23Tkq2uLTJHA.5344@xxxxxx Quote: >> Why do I get this error on line 5; Object required (WScript) - Arguments >> But the script runs ok, no errors. >> Only get this error when I debug with Web_Ed editor. >> >> 'This script will Enable User Account Control >> >> Dim WshShell, ObjShell, Message >> >> Line 5 here > If WScript.Arguments.length = 0 Then >> Set ObjShell = CreateObject("Shell.Application") >> ObjShell.ShellExecute "wscript.exe", """" & _ >> WScript.ScriptFullName & """" & " uac","", "runas", 1 >> Else >> Message = "This script will Enable User Account Control." & vbCr & vbCr _ >> & "After you Run this script, you must Reboot for this to take effect." & >> vbCr & vbCr _ >> & "Adding information can unintentionally change or delete values and >> cause components to stop working correctly." _ >> & " If you do not trust the source of this information, do not add it to >> the registry." & vbCr & vbCr _ >> & "Would you like to continue?" >> >> Set WshShell = WScript.CreateObject("WScript.Shell") >> >> M = MsgBox(Message, vbYesNo + vbInformation, "Tweaks") >> If M = 6 Then >> >> WshShell.RegWrite >> "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA", >> 1, "REG_DWORD" >> >> Message = "UAC is now ENABLED!" & vbCr & vbCr _ >> & "You must Reboot for this change to take effect." >> MsgBox Message, 64, "Tweaks" >> End If >> End If > Can't tell - you need to post lines 1 to 4 too. > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Error Check out Richard's reply - his suggestion about unavailable objects appears to be spot on. "PaulM" <NONO@xxxxxx> wrote in message news:Ov3Tc9LTJHA.4680@xxxxxx Quote: > Right here: > > Line 1.> 'This script will Enable User Account Control > Line 2.> > Line 3.> Dim WshShell, ObjShell, Message > Line 4.> > Line 5 here > If WScript.Arguments.length = 0 Then > Line 6.>Set ObjShell = CreateObject("Shell.Application") > Line 7.> ObjShell.ShellExecute "wscript.exe", """" & _ > Line 8.> WScript.ScriptFullName & """" & " uac","", "runas", 1 > Line 9.> Else > > And so on. > > > "Pegasus (MVP)" <I.can@xxxxxx> wrote in message > news:#tRsG4LTJHA.4680@xxxxxx Quote: >> >> "PaulM" <NONO@xxxxxx> wrote in message >> news:%23Tkq2uLTJHA.5344@xxxxxx Quote: >>> Why do I get this error on line 5; Object required (WScript) - Arguments >>> But the script runs ok, no errors. >>> Only get this error when I debug with Web_Ed editor. >>> >>> 'This script will Enable User Account Control >>> >>> Dim WshShell, ObjShell, Message >>> >>> Line 5 here > If WScript.Arguments.length = 0 Then >>> Set ObjShell = CreateObject("Shell.Application") >>> ObjShell.ShellExecute "wscript.exe", """" & _ >>> WScript.ScriptFullName & """" & " uac","", "runas", 1 >>> Else >>> Message = "This script will Enable User Account Control." & vbCr & vbCr >>> _ >>> & "After you Run this script, you must Reboot for this to take effect." >>> & vbCr & vbCr _ >>> & "Adding information can unintentionally change or delete values and >>> cause components to stop working correctly." _ >>> & " If you do not trust the source of this information, do not add it >>> to the registry." & vbCr & vbCr _ >>> & "Would you like to continue?" >>> >>> Set WshShell = WScript.CreateObject("WScript.Shell") >>> >>> M = MsgBox(Message, vbYesNo + vbInformation, "Tweaks") >>> If M = 6 Then >>> >>> WshShell.RegWrite >>> "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA", >>> 1, "REG_DWORD" >>> >>> Message = "UAC is now ENABLED!" & vbCr & vbCr _ >>> & "You must Reboot for this change to take effect." >>> MsgBox Message, 64, "Tweaks" >>> End If >>> End If >> Can't tell - you need to post lines 1 to 4 too. >> |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Error > Line 5 here > If WScript.Arguments.length = 0 Then WScript is only available when running scripts with WScript. If your script is running in a webpage, for instance, you can't use the WScript object. Also, if you're using VBS I wonder if you want count rather than length. According to the WSH help, count returns the number of items in a dictionary or collection. (Arguments is a collection.) That's also true in VB. Arguments.length shows up in the javascript sample code, so maybe that's a JS-specific way to handle collections. On the other hand, I just tried running a script: msgbox wscript.arguments.length and it works fine, showing a msgbox containing "0". Strange. It's odd that the WSH help doesn't seem to specifically list the properties and methods of collection objects. |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Error > It seems we are not seeing the whole script. I don't see where you use Quote: > Wscript.Arguments. However, possibly the Wscript object is not available Quote: > Web_Ed editor. This object is provided by the wscript (or cscript) host > program. The script must be launched by one of these host programs, or the > Wscript objects and methods are not available (like Wscript.Sleep for > example). > (unless CScript has been selected). I'm guessing that the script is running in a webpage, even though the code showing doesn't look that way. |
My System Specs![]() |
| | #8 (permalink) |
| | Re: Error Thanks for all the help, its just odd that I get that error, but the script works fine. No big deal. "mayayana" <mayaXXyana@xxxxxx> wrote in message news:eSTvqHMTJHA.1160@xxxxxx Quote: Quote: >> Line 5 here > If WScript.Arguments.length = 0 Then > WScript is only available when running scripts > with WScript. If your script is running in a webpage, > for instance, you can't use the WScript object. > > Also, if you're using VBS I wonder if you want count > rather than length. According to the WSH help, > count returns the number of items in a dictionary > or collection. (Arguments is a collection.) That's also > true in VB. > Arguments.length shows up in the javascript > sample code, so maybe that's a JS-specific way to > handle collections. > On the other hand, I just tried running a script: > > msgbox wscript.arguments.length > > and it works fine, showing a msgbox containing "0". > Strange. It's odd that the WSH help doesn't seem to > specifically list the properties and methods of collection > objects. > > > |
My System Specs![]() |
| | #9 (permalink) |
| | Re: Error When your script runs it may give you results that you feel are acceptable, but they are only coincidentally correct. It is not good practice to include code that fails to do what it is intended to accomplish. /Al "PaulM" <NONO@xxxxxx> wrote in message news:uP1WcVMTJHA.3932@xxxxxx Quote: > Thanks for all the help, its just odd that I get that error, but the > script works fine. > No big deal. > > > "mayayana" <mayaXXyana@xxxxxx> wrote in message > news:eSTvqHMTJHA.1160@xxxxxx Quote: Quote: >>> Line 5 here > If WScript.Arguments.length = 0 Then >> WScript is only available when running scripts >> with WScript. If your script is running in a webpage, >> for instance, you can't use the WScript object. >> >> Also, if you're using VBS I wonder if you want count >> rather than length. According to the WSH help, >> count returns the number of items in a dictionary >> or collection. (Arguments is a collection.) That's also >> true in VB. >> Arguments.length shows up in the javascript >> sample code, so maybe that's a JS-specific way to >> handle collections. >> On the other hand, I just tried running a script: >> >> msgbox wscript.arguments.length >> >> and it works fine, showing a msgbox containing "0". >> Strange. It's odd that the WSH help doesn't seem to >> specifically list the properties and methods of collection >> objects. >> >> >> |
My System Specs![]() |
| | #10 (permalink) |
| | Re: Error I have about 50 scripts all for Vista and all get the same error in Web-Ed and all the scripts work fine. Maybe it is something in Web-Ed. "Al Dunbar" <alandrub@xxxxxx> wrote in message news:#ivP0TrTJHA.2468@xxxxxx Quote: > When your script runs it may give you results that you feel are > acceptable, but they are only coincidentally correct. It is not good > practice to include code that fails to do what it is intended to > accomplish. > > /Al > > "PaulM" <NONO@xxxxxx> wrote in message > news:uP1WcVMTJHA.3932@xxxxxx Quote: >> Thanks for all the help, its just odd that I get that error, but the >> script works fine. >> No big deal. >> >> >> "mayayana" <mayaXXyana@xxxxxx> wrote in message >> news:eSTvqHMTJHA.1160@xxxxxx Quote: >>>> Line 5 here > If WScript.Arguments.length = 0 Then >>> >>> WScript is only available when running scripts >>> with WScript. If your script is running in a webpage, >>> for instance, you can't use the WScript object. >>> >>> Also, if you're using VBS I wonder if you want count >>> rather than length. According to the WSH help, >>> count returns the number of items in a dictionary >>> or collection. (Arguments is a collection.) That's also >>> true in VB. >>> Arguments.length shows up in the javascript >>> sample code, so maybe that's a JS-specific way to >>> handle collections. >>> On the other hand, I just tried running a script: >>> >>> msgbox wscript.arguments.length >>> >>> and it works fine, showing a msgbox containing "0". >>> Strange. It's odd that the WSH help doesn't seem to >>> specifically list the properties and methods of collection >>> objects. >>> >>> >>> > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Help with windows vista mail, Socket Error: 10053, Error Number: 0x800CCC0F | Vista mail | |||
| no,socket Error: 11003. Error Number: 0x800CC0D cant i send email name is correctly | Vista mail | |||
| Canot post to newsgroups Socket Error: 10053, Error Number: 0x800CCC0F | Vista mail | |||
| Canot post to newsgroups Socket Error: 10053, Error Number: 0x800CCC0F | Vista General | |||
| windows live mail 2008 (Build 12.0.1606) error report error | Windows Live | |||