Solved

Adding a registry key during vb logon script

Posted on 2009-05-06
4
558 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

626 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