Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Adding a registry key during vb logon script

Posted on 2009-05-06
4
Medium Priority
?
569 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

916 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