Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Re: VBScript runtime error: Variable is undefined: 'System'

Reply
 
Old 03-30-2009   #1 (permalink)
Pegasus [MVP]


 
 

Re: VBScript runtime error: Variable is undefined: 'System'


"Thomas Lebrecht" <t.lebrecht@xxxxxx> wrote in message
news:49d08c9b$0$31862$9b4e6d93@xxxxxx-online.net...
Quote:

>I tried to use a function
>
> System.IO.Path.GetFileName(strFile)
>
> in a .vbs script.
>
> But when I start the script VBS told me:
>
> VBScript runtime error: Variable is undefined: 'System'
>
> I defined at the top:
>
> Option Explicit
>
> Do I have to declare soemthing for "System" functions in addition?
>
> Thomas
>
In line 15 you need to add "System" to your Dim statement.



My System SpecsSystem Spec
Old 03-30-2009   #2 (permalink)
Joe Fawcett


 
 

Re: VBScript runtime error: Variable is undefined: 'System'

You are writing a script yet System.IO.Path looks like a .NET namespace.
Where did you get the idea to use that in script? It's not possible in that
fashion.

--

Joe Fawcett (MVP - XML)

http://joe.fawcett.name

"Thomas Lebrecht" <t.lebrecht@xxxxxx> wrote in message
news:49d08c9b$0$31862$9b4e6d93@xxxxxx-online.net...
Quote:

>I tried to use a function
>
> System.IO.Path.GetFileName(strFile)
>
> in a .vbs script.
>
> But when I start the script VBS told me:
>
> VBScript runtime error: Variable is undefined: 'System'
>
> I defined at the top:
>
> Option Explicit
>
> Do I have to declare soemthing for "System" functions in addition?
>
> Thomas
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Microsoft VBScript runtime error VB Script
VBScript runtime error installing MS Win Installer Cleanup Util Vista installation & setup
VBScript Runtime Error 800A0046 Dell 944 Printer Software/Driver Vista security
VBScript Runtime Error 800A0046 Dell 944 Printer Software/Driver I Vista networking & sharing
VBScript Runtime Error 800A0046 Dell 944 Printer Software/Driver I Vista installation & setup


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46