Solved

Adding a registry key during vb logon script

Posted on 2009-05-06
4
547 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to writing scripts for a Client/Server computing environment it is essential to consider some way of enabling the authentication functionality within a script. This sort of consideration mainly comes into the picture when we are dealin…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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