|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Undefined variable in login scriptThe following script consistently generates an error every time the (test) user logs in. My syntax, as far as I am concerned, is correct. ************************************* Dim objShell Dim Shell Dim objURLShortcut Dim strDesktopfld 'Create 'IT Support' shortcut to Desktops Set objShell = WScript.CreateObject("WScript.Shell") strDesktopfld = objShell.SpecialFolders("Desktop") Set objURLShortcut = objShell.CreateShortcut(strDesktopFld & "\IT Support.url") ' Name for 'Shortcut to add objURLShortcut.TargetPath = "http://website.com" ' Path for shortcut objURLShortcut.Save Set Shell = CreateObject( "WScript.Shell" ) Any help is appreciated. Thanks! Preston -- prezpwns ------------------------------------------------------------------------ prezpwns's Profile: http://forums.techarena.in/members/prezpwns.htm View this thread: http://forums.techarena.in/server-scripting/1126498.htmhttp://forums.techarena.in
Show quote
Hide quote
"prezpwns" <prezpwns.3nv7vb@DoNotSpam.com> wrote in message If the error message is generated by the VB Script interpreter then it will news:prezpwns.3nv7vb@DoNotSpam.com... > > Hello all, > > The following script consistently generates an error every time the > (test) user logs in. My syntax, as far as I am concerned, is correct. > > ************************************* > Dim objShell > Dim Shell > Dim objURLShortcut > Dim strDesktopfld > > 'Create 'IT Support' shortcut to Desktops > Set objShell = WScript.CreateObject("WScript.Shell") > strDesktopfld = objShell.SpecialFolders("Desktop") > Set objURLShortcut = objShell.CreateShortcut(strDesktopFld & "\IT > Support.url") ' Name for > > 'Shortcut to add > objURLShortcut.TargetPath = "http://website.com" ' Path for shortcut > objURLShortcut.Save > Set Shell = CreateObject( "WScript.Shell" ) > > > Any help is appreciated. Thanks! > > Preston give you a line number. Which one is it? Which line does the number refer to?
Show quote
Hide quote
"Pegasus (MVP)" <I.***@fly.com.oz> wrote in message Seemed like a fairly simple script containing no hidden danger, so I tested news:ug3cIdrkJHA.3480@TK2MSFTNGP06.phx.gbl... > > "prezpwns" <prezpwns.3nv7vb@DoNotSpam.com> wrote in message > news:prezpwns.3nv7vb@DoNotSpam.com... >> >> Hello all, >> >> The following script consistently generates an error every time the >> (test) user logs in. My syntax, as far as I am concerned, is correct. >> >> ************************************* >> Dim objShell >> Dim Shell >> Dim objURLShortcut >> Dim strDesktopfld >> >> 'Create 'IT Support' shortcut to Desktops >> Set objShell = WScript.CreateObject("WScript.Shell") >> strDesktopfld = objShell.SpecialFolders("Desktop") >> Set objURLShortcut = objShell.CreateShortcut(strDesktopFld & "\IT >> Support.url") ' Name for >> >> 'Shortcut to add >> objURLShortcut.TargetPath = "http://website.com" ' Path for shortcut >> objURLShortcut.Save >> Set Shell = CreateObject( "WScript.Shell" ) >> >> >> Any help is appreciated. Thanks! >> >> Preston > > If the error message is generated by the VB Script interpreter then it > will give you a line number. Which one is it? Which line does the number > refer to? it. Once, I removed the syntactically incorrect comment line with asterisks and corrected the line wrap, it worked perfectly. When I re-introduced the line-wrap in the second SET statement, it produced this error: "unterminated string constant". I expect that the OP either mis-interpreted the error message, or that the script as posted is not a complete copy. I fixed the linewrap and added an OPTION EXPLICIT message, and still no error message. I'd suggest that the OP answer your question, post the entire script, and explain where the script is stored, how the file is named, and what mechanism makes it run at logon. /Al Sorry - i suppose that would be helpful:
Line: 11 (Set objShell)
Char: 1
Code:800a01f4
Source: MicrosoftVBscript Runtime error
--
prezpwns
------------------------------------------------------------------------
prezpwns's Profile: http://forums.techarena.in/members/prezpwns.htm
View this thread: http://forums.techarena.in/server-scripting/1126498.htmhttp://forums.techarena.in
I had tested the script you posted, same as Al Dunbar, and it ran just fine,
same as with Al. This draws me to one of two conclusions: - You're not posting the script that causes the problem. - The problem is reported by a different script than what you think. Put some markers of the form wscript.echo "Label 1" wscript.echo "Label 2" into your script so that you can see where the problem occurs! Show quoteHide quote "prezpwns" <prezpwns.3nvdfd@DoNotSpam.com> wrote in message news:prezpwns.3nvdfd@DoNotSpam.com... > > Sorry - i suppose that would be helpful: > > Line: 11 (Set objShell) > Char: 1 > Code:800a01f4 > Source: MicrosoftVBscript Runtime error > > > -- > prezpwns > ------------------------------------------------------------------------ > prezpwns's Profile: http://forums.techarena.in/members/prezpwns.htm > View this thread: http://forums.techarena.in/server-scripting/1126498.htm > > http://forums.techarena.in > "prezpwns" <prezpwns.3nvdfd@DoNotSpam.com> wrote in message Can't duplicate the error. We must not be seeing all of the script. The "Set news:prezpwns.3nvdfd@DoNotSpam.com... > > Sorry - i suppose that would be helpful: > > Line: 11 (Set objShell) > Char: 1 > Code:800a01f4 > Source: MicrosoftVBscript Runtime error > objShell" statement seems to be on line 7 in what you posted.
modify incremental_backup
Drop leading zeros in a variable Deleting and re-installing printer with new name using login scrip send mail if ping faile Echo to column position Script for deleting folders + content in root of D:\ after # days Script to set user permissions Scruot to check user rights on folders/subfolders startup scripting File copy and paste script |
|||||||||||||||||||||||