×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

VBScript Promblem with using wscript.shell

VBScript Promblem with using wscript.shell

VBScript Promblem with using wscript.shell

(OP)
Hello everyone
i am using a software name MCPS. and there is a possibility to write a script in this program. the scripts from this program contains the extension .mbs and not .vbs
creating wscript object doesn't make a problem but when using there commands for example the name of file or directory ..etc
i come with this error:
wscript is not defined
so is there any way that i can call or get this object
for example when use :
Set objXL = GetObject(,"Excel.Application")
its working . i have tried to GetObject(,"WScript.shell") but it giving me another error related to activeX error activex component can't create object
please help. thanks
the script is :

Option Explicit

'******************** Deklarationen ********************
DIM Main_Fenster 'the main window variable
DIM Run_Window 'Main Window
DIM SType ' Varialbe to store the script call type : 6 First run and 3 for Scan while scaning
DIM Text1 'Main window name Text
DIM Text2 ' Abluf Box selection Text name
DIM SelBoxAblauf 'selection Box for choosing the Abluaf of the Measurment
DIM SelBoxAblauf_Value 'Selectoin Box value for Ablauf
DIM Text3 'Database path show
DIM Project_Path
DIM DatabasePath_Default
DIM DatabasePath_Default_Help
DIM DatabasePath_Default_Help_Open
DIM SystmeObject
DIM SystmeObject2
DIM i
'******************** Paramete_Init *********************

'******************** Main_Start *********************
SType = MCPS.GetScriptType 'to know why the script is call. first run or normal scan
call Get_Value_Window






'******************** Startfenster *********************
Sub Get_Value_Window
Main_Fenster=MCPS.DialogCreate("Druck Kalibrierung Flucke 6270A",1000,800,0) 'name of the dialoge and size of it
Text1 = MCPS.DialogAddText(Main_Fenster,"Druckkalibrierung mit Flucke 6270A",400,5,250,25,4096)

'Database Path to show and get
call DatabasePathSub
Text3 = MCPS.DialogAddText(Main_Fenster,DatabasePath_Default,50,80,300,25,0)
'Ablauf Text Selection Box
Text2 = MCPS.DialogAddText(Main_Fenster,"Abluaf",50,10,60,25,0)
SelBoxAblauf = MCPS.DialogAddSelection(Main_Fenster,50,30,60,25,0)
SelBoxAblauf_Value = MCPS.DialogAddSelectionString(Main_Fenster,SelBoxAblauf,"A")
SelBoxAblauf_Value = MCPS.DialogAddSelectionString(Main_Fenster,SelBoxAblauf,"B")
SelBoxAblauf_Value = MCPS.DialogAddSelectionString(Main_Fenster,SelBoxAblauf,"C")
SelBoxAblauf_Value = MCPS.DialogAddSelectionString(Main_Fenster,SelBoxAblauf,"Benutzer")
'End from Abluf Text Selection Box

Run_Window=MCPS.DialogRun(Main_Fenster) 'to wait for the answere of the user
End Sub


Sub DatabasePathSub
Set SystmeObject = CreateObject("WScript.shell")
DatabasePath_Default_Help = Left(WScript.ScriptFullname,(Len(WScript.ScriptFullname))-(Len(WScript.ScriptName)))
DatabasePath_Default_Help = DatabasePath_Default_Help&"Flucke6270AskriptDatabasePath.txt"
'
'
End Sub

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close