Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript Promblem with using wscript.shell

Status
Not open for further replies.

Majdgh

Programmer
Jun 8, 2018
1
0
0
DE
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

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top