-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart.vbs
156 lines (46 loc) · 1.85 KB
/
start.vbs
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
Function PathRemoveFileSpec2(strFileName)
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "([^\\/]*)$"
PathRemoveFileSpec2 = RegEx.Replace(strFileName, "")
Set RegEx = Nothing
End Function
Function PathRemoveFileSpec4(strFileName)
Dim fso,file
Set fso = WSH.CreateObject("Scripting.FileSystemObject")
If fso.FileExists(strFileName) Then
Set file = fso.GetFile(strFileName)
PathRemoveFileSpec4 = fso.GetParentFolderName(file)
Set file = Nothing
ElseIf fso.FolderExists(strFileName) Then
PathRemoveFileSpec4 = strFileName
Else
PathRemoveFileSpec4 = PathRemoveFileSpec2(strFileName)
End If
Set fso = Nothing
End Function
ThisDirPath = PathRemoveFileSpec4(WScript.ScriptFullName)
Set objArgs = WScript.Arguments
argumentsCount = objArgs.Count
Device = ""
If argumentsCount > 0 Then
Device = objArgs.item(0)
Device = Trim(Device)
End If
Dim oShell,sCommand
set oShell = CreateObject("WScript.Shell")
oShell.CurrentDirectory = ThisDirPath
'sCommand = "cmd /c " & ThisDirPath & "\" & "himawari-rx__auto.bat"
'If Not Device = "" Then
'sCommand = sCommand & " " & Device
'End If
If Device = "" Then
sCommand = "cmd /c " & Chr (34) & ThisDirPath & "\" & "himawari-rx__auto.bat" & Chr (34)
Else
sCommand = "cmd /c " & Chr (34) & Chr (34) & ThisDirPath & "\" & "himawari-rx__auto.bat" & Chr (34) & " " & Device & Chr (34)
End If
oShell.Run sCommand, 1, False
'sCommand = "cmd /c time_monitor_to_terminate_TSDuck.bat"
sCommand = "cmd /c " & Chr (34) & ThisDirPath & "\" & "time_monitor_to_terminate_TSDuck.bat" & Chr (34)
oShell.Run sCommand, 1, False
set oShell = Nothing