Solved

Adding a registry key during vb logon script

Posted on 2009-05-06
4
507 Views
Last Modified: 2012-05-06
I currently get an error on my logon script intermittently. It states:

CMD.EXE was st arted with the avove path as the current directory.
UNC pats are not supported. Defaulting to Windows directory.

After doing research, I found that I need ti add the value DisableUNCCheck REG_DWORD and set the value to 0 x 1 (Hex).

Any help with adding this key in my script? Thank you.

0
Comment
Question by:Neil2526
  • 2
4 Comments
 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 24314515
you can find few examples on working with windows registry here
http://www.computerperformance.co.uk/Logon/VBScript/VBScript_Windows_registry.htm

0
 

Author Comment

by:Neil2526
ID: 24314595
Thanks for the link shasunder -

but that site shows how to edit a current key, i need to create a command similar to this:


REG ADD "HKCU\Software\Microsoft\Command Processor" /V DisableUNCCheck /T REG_DWORD /F /D 1
0
 
LVL 14

Accepted Solution

by:
yehudaha earned 500 total points
ID: 24315011
try this
const HKEY_CURRENT_USER = &H80000001

strComputer = "."

 

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 

strComputer & "\root\default:StdRegProv")

 

strKeyPath = "Software\Microsoft\Command Processor"
 

oReg.CreateKey HKEY_CURRENT_USER,strKeyPath

 

strValueName = "DisableUNCCheck"

dwValue = 1

oReg.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

Open in new window

0
 
LVL 14

Expert Comment

by:yehudaha
ID: 24315029
this is the full script save as vbs
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now