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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disables the File Sharing Wizard in windows 7

Status
Not open for further replies.

Briandr

MIS
Jul 11, 2003
177
US
Hi,

I found this somewhere else and it disables the File Sharing Wizard in windows 7. The first time I ran it things looked good. On a second run after re-enabling the File Sharing Wizard it did not appear to work. Any thoughts on the code:

Option Explicit
Dim objShell, FileExt, SharWiz, CheckBox, strModify, strDelete
FileExt = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\HideFileExt\DefaultValue"
SharWiz = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\SharingWizardOn\DefaultValue"
CheckBox= "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\AutoCheckSelect\DefaultValue"

Set objShell = CreateObject("WScript.Shell")
strModify = objShell.RegWrite(FileExt,"00000000","REG_DWORD")
strModify = objShell.RegWrite(SharWiz,"00000000","REG_DWORD")
strModify = objShell.RegWrite(CheckBox,"00000000","REG_DWORD")
Wscript.Quit

Thanks.
 
Hi,

Thanks for the link. Did not come across that when searching through google. So are you suggesting do this for the current user or modifying this so that it works for the default user as suggested by the poster in the other forum? I would prefer to this for the default user and let this run out of the c:\users\default\appdata\Roaming\Microsoft\WindowsStart Menu\Programs\Start Up folder. Then delete out the script from the start up folder.

Option ExplicitDim objShell, FileExt, SharWiz, CheckBox, strModify, strDelete, objDesktop
FileExt = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt"
SharWiz = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\SharingWizardOn"
CheckBox= "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\AutoCheckSelect"
Set objShell = CreateObject("WScript.Shell")
objDesktop = objShell.SpecialFolders("Desktop")
strModify = objShell.RegWrite(FileExt,"00000000","REG_DWORD")
strModify = objShell.RegWrite(SharWiz,"00000000","REG_DWORD")
strModify = objShell.RegWrite(CheckBox,"00000000","REG_DWORD")
objShell.AppActivate objDesktop
objShell.SendKeys "{F5}"

DeleteSelf

Sub DeleteSelf()
Dim objFSO
'Create a File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Delete the currently executing script
objFSO.DeleteFile WScript.ScriptFullName
Set objFSO = Nothing
End Sub
Wscript.Quit

Thanks.
 
Hi Again,

Option ExplicitDim objShell, FileExt, SharWiz, CheckBox, strModify, strDelete, objDesktop
FileExt = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt"
SharWiz = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\SharingWizardOn"
CheckBox= "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\AutoCheckSelect"
Set objShell = CreateObject("WScript.Shell")
[highlight #EF2929]objDesktop = objShell.SpecialFolders("Desktop")[/highlight]
strModify = objShell.RegWrite(FileExt,"00000000","REG_DWORD")
strModify = objShell.RegWrite(SharWiz,"00000000","REG_DWORD")
strModify = objShell.RegWrite(CheckBox,"00000000","REG_DWORD")
objShell.AppActivate objDesktop
objShell.SendKeys "{F5}"

DeleteSelf

Sub DeleteSelf()
Dim objFSO
'Create a File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Delete the currently executing script
objFSO.DeleteFile WScript.ScriptFullName
Set objFSO = Nothing
End Sub

Thanks again
 
Sorry for the repeated postings. I am not trying to spam the board. I wish I could figure out how to edit my post.

The stuff in red I should not need or am I wrong?
 
So are you suggesting do this for the current user or modifying this so that it works for the default user as suggested by the poster in the other forum? I would prefer to this for the default user

Not necessarily, all I did was try to locate where you got that code from, hoping for additional clues as to your problem. Instead, I found that link which at least verified that someone else had the same problem as you, with no solution posted on that site.

Sorry, I don't have any specific advice other than to say, my preference of solutions would be
1) If in a windows domain, try to implement these changes via Group Policy. Easier, and permanent.
2) Write a vbscript, as you are trying to do... (but no success yet)
3) Change the default user profile
4) Use the awkward solution in the link I posted, which is to create a login script to do the dirty work

If you are open to some non-vbscript solutions, you may want to post in forum1726
 
Also, currently you cannot edit posts... But if you really needed something changed, you can red-flag your post with an explanation, and management will try to oblige.
 
Hi,

Maybe the next time the website gets updated there will be a feature to edit posts would be nice. So the vbscript with the lines in red removed I am placing in:

c:\users\default\appdata\Roaming\Microsoft\Windows\Start Menu\Programs\Start Up folder

That should work in the interm as the current user should at least initially have the File Sharing Wizard turned off. I do agree GPO might work best, but sometimes getting it in place can be a royal pain.

Thanks again.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top