Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by whoam
at 2024-07-28 18:43:22
Point:500 Replies:5 POST_ID:828627USER_ID:11491
Topic:
VB Script;;
Hello,
I borrowed a script form http://www.ingmarverheij.com/vmware-shared-folders-keep-profiles-in-use/.
Upon running it I get an "invalid root in registry key" error, last line char 4.
I tried to make it HKEY_LOCAL_MACHINE but got the same error.
What am I missing?
I borrowed a script form http://www.ingmarverheij.com/vmware-shared-folders-keep-profiles-in-use/.
Upon running it I get an "invalid root in registry key" error, last line char 4.
I tried to make it HKEY_LOCAL_MACHINE but got the same error.
What am I missing?
'Define variables Dim objShell Dim strProviderOrder'Connect to subssystems Set objShell = WScript.CreateObject("WScript.Shell")'Read registry key strProviderOrder = objShell.RegRead("HKLMSYSTEMCurrentControlSetControlNetworkProviderOrderProviderOrder")'Remove VMware Shared Folder strProviderOrder = Replace(strProviderOrder, "vmhgfs,", "", 1, -1, 1) strProviderOrder = Replace(strProviderOrder, "vmhgs,", "", 1, -1, 1) strProviderOrder = Replace(strProviderOrder, "hgfs,", "", 1, -1, 1)'Write registry key objShell.RegWrite "HKLMSYSTEMCurrentControlSetControlNetworkProviderOrderProviderOrder", strProviderOrder, "REG_SZ" 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:
Accepted Solution
Expert: RobSampson replied at 2024-07-29 21:34:10
500 points EXCELLENT
Hi, you are getting that error because you don't have permission to write to the value. You need to run the script from an elevated command prompt.
Run cmd.exe by right-clicking it, then "Run as administrator", then run
cscript C:ScriptsTest.vbs
Regards.
Rob.
Run cmd.exe by right-clicking it, then "Run as administrator", then run
cscript C:ScriptsTest.vbs
Regards.
Rob.
Expert: duncanb7 replied at 2024-07-29 16:46:47
I mean what you get from the error message when you run F8 key on
the code at
strProviderOrder = Replace(strProviderOrder, "vmhgfs,", "", 1, -1, 1)
strProviderOrder = Replace(strProviderOrder, "vmhgs,", "", 1, -1, 1)
strProviderOrder = Replace(strProviderOrder, "hgfs,", "", 1, -1, 1)
What the error message is exactly ?
the code at
strProviderOrder = Replace(strProviderOrder, "vmhgfs,", "", 1, -1, 1)
strProviderOrder = Replace(strProviderOrder, "vmhgs,", "", 1, -1, 1)
strProviderOrder = Replace(strProviderOrder, "hgfs,", "", 1, -1, 1)
What the error message is exactly ?
Author: whoam replied at 2024-07-29 16:42:45
Sedgwick,
strProviderOrder is
strProviderOrder is
Duncanb7,
I ammended the Dim statment as you have, but that created an error.
Expert: duncanb7 replied at 2024-07-29 01:20:44
Correction----->Dim strProviderOrder As String
and then you echo out strProviderOrder to see what is result first
and then you echo out strProviderOrder to see what is result first
Expert: sedgwick replied at 2024-07-28 22:53:14
what's the value of strProviderOrder before regWrite?