Over 1 million tech questions and answers.

Solved: Create a ODBC connection with a script

Q: Solved: Create a ODBC connection with a script

Hello everyone
Ok, So here is the deal. I have a My SQL database that is being used with a Access 2003 front end. Its using the MY SQL ODBC driver and a User DSN. I have to deploy this front end to about 200 people and don't want to visit each computer to do so. I need to install the drive which i have built a script to do, and i need to create a DSN. How do i create a User DSN or a system DSN with a batch file with a script. I tried to use a File DSN,Which would have made my life easy as i could just have copied that file to all the computers, But it promoted the user to log into the database when a form is open. Which is no good. Can anyone help me?

Preferred Solution: Solved: Create a ODBC connection with a script

I recommend downloading and running DAP. It can help sort out any driver and firmware related issues on your system

It's worked out well for many of us in the past.

You can download it direct from this link http://downloaddap.org. (This link will open the download page of DAP so you can save a copy to your computer.)

A: Solved: Create a ODBC connection with a script

I found a code that will work, Thanks

Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."

Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources"
strValueName = "Script Repository"
strValue = "SQL Server"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strKeyPath = "SOFTWARE\ODBC\ODBC.INI\Script Repository"

objReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath

strKeyPath = "SOFTWARE\ODBC\ODBC.INI\Script Repository"

strValueName = "Database"
strValue = "Script Center"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strValueName = "Driver"
strValue = "C:\WINDOWS\System32\SQLSRV32.dll"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strValueName = "Server"
strValue = "atl-sql-01"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strValueName = "Trusted_Connection"
strValue = "Yes"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

Read other 1 answers

Create a batch script for Oracle ODBC connection

Read other answers

how I can create a ODBC Connection in windows 8.1 
I am use SQl server Express 2008

Read other answers

" the setup routines for the oracle odbc driver could not be loaded due to system error code 998"

Trying to create ODBC connection and then get this error message

also getting same error when trying to remove or edit connection ..

please advice ..URGENT

A:Cant create ODBC connection data resources

You may have the wrong driver as the error suggests.

Try Informix:


Read other 2 answers


I'm not sure if i'm posting this in the correct area, but please let me know and I will move to appropriate forum.

I have a application I use that connects to a default ODBC connection "Connection1" which is the production enviroment. I want to create a shortcut on my desktop to point to the TEST enviroment so I don't have to go through and change odbc settings all the time. I added a SQL Server connection under System DSN "Connection2" which point to test database. In the shortcut properties I added to the end of the Target location "-oConnection2" so it looks like this:

C:\programfiles\app\app.exe -o"Connection2"

I saw this setup at another location and trying to set it up on my workstation. I know it's something simple i'm missing. Any help or direction would be great.

Read other answers

Mac OS X 10.6.1
perl 5.8
mysql 5.1
Installed ODBC connector: http://dev.mysql.com/downloads/connector/odbc/5.1.html#macosx-dmg
I am trying to connect to a mysql DB using the perl API.

The connect command looks like this:
$dbHandle = DBI->connect("DBI:ODBC:gfr:localhost", "gfr", "gfr");

It produces the error:
DBI connect('gfr:localhost','gfr',...) failed: [iODBC][Driver Manager]Data source name not found and no default driver specified. Driver could not be loaded (SQL-IM002) at x.pl line 30
error = [iODBC][Driver Manager]Data source name not found and no default driver specified. Driver could not be loaded (SQL-IM002)

I'v done hours of rummaging around the web to find a solution but to now avail.

In desperation I executed the following "find" command:
cd /
sudo find . -name "*odbc*" -print

It produced the following output (only relevant part shown):
./usr/local/li... Read more

A:Solved: mysql connection using ODBC fails with error SQL_IM002

By using a combination of the information at
and the link within that page under "these simple instructions" (http://www.truerwords.net/articles/osx/install_dbd_mysql.html)
I managed to get DBD working instead of ODBC. That is sufficient for me.
I did the above with one difference. I used a later version of the latest non-beta DBD module.

Read other 1 answers

Hi all,
I have a strange problem that occur on lots of our machine,
We deploy a fresh Windows 7 32Bit OS from SCCM.
I created a script that adds a "Microsoft ODBC for Oracle" DSN on all of our workstation (part of the task sequence).
I tested the script and its work great, but...
Some users have problem that the DSN is not showing on the "ODBC Data Source Administrator"

Now, when I try to manually add the DSN, the moment I select "Microsoft ODBC for Oracle" i get the following error -

I'm googling the web for few days now and cant find a solution...
Please help...

A:Microsoft ODBC for Oracle - Fail to create

Correct, I based my opinion on the error about the components apparently missing. Here is a Knowledge base article about troubleshooting this very issue:
How To Troubleshoot an ASP-to-Oracle Connectivity Problem
There is a similar thread on the Oracle forums which contains some solutions you can attempt to fix your problem:
Thread: Oracle client and networking components were not found

Do those steps resolve your issue?

Read other 10 answers

I'm trying to look at stored procedures in a database to make sure there are no crossserver or cross database joins so we can upgrade to SQL Server 2005 from SQL 2000

Can anyone tell me a script i could use to see all procedure scripts at once?

Or do you have any other idea?


Read other answers

I have connected to a Access DataBase through AutoCAD for 3 years. Recently I get a error SQL client unable to establish SQL connection.
Microsoft ODBC Microsoft Access Driver System Resource exceeded.

Database record is small.
Have looked at other postings on this problem and none seems to be relative. Also most I do not understand how to do what is recommened.
Windows XP
AutoCAD 2013
Access 2007 database.
All help would be appreciated but include steps for trouble shooting.
Thank you in advance

Read other answers

I am trying to connect to access 2007 but in my odbc there is only a driver for SQL I have 64 bit. I have read some fixes here but still have figured it out can anyone help.

Read other answers

I've developed a site www.kitkrazy.com using PHP, Access and an ODBC connection. It works very well ... most of the time.

Every now and again -- say every three months -- the site crashes, and I get the error message ...

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Too many client tasks.,

Most recently I got ...

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] System resource exceeded., SQL state S1001 in SQLExecDirect in E:\home\Default\kitkrazy.com\htdocs\include\topthree.php on line 15
[Microsoft][ODBC Microsoft Access Driver] System resource exceeded.

When I challenge the hosting company on this they always advise me to use a DSN-less connection. Well, it's got to the point where I'm thinking to myself, why don't I just go DSN-less and the hell with it.

So I took a look. And it seems that I'm going to have to rewrite all my SQL queries and database calls. Unless you know different ...

Is there a simple way to convert all my code from ODBC to DSN-less?


A:PHP: Converting from ODBC to DSN-less connection

You should probably convert to MySQL or a real database if you are having trouble with too many users accessing the database. You may also want to check all of your code to see that it is clean and you are closing all open object when the program is done with them. You will have the exact same problem with with a DSN-less connection and it will actually slow your site down. Rewriting the connection string is the only change you will need to make and if you use an include file for the DB connection string all you need to do is change one file.

Read other 2 answers

I'm running 2005 SQL server on Windows 2008 server. I have both Windows 7 and XP ODBC connections to the server. Everything was working fine but the server was running slow so I tried a windows update. The update made my ODBC connection go flakey, but only on Windows 7. Testing the connection would be successful, for several tests, then fail and you would have to reboot the workstation. I have both SQL server and Native Client. Now I am unable to create a connection with either. I've uninstalled the updates which hasn't helped. It seems like the update changed a security setting somewhere. Creating a new connection now fails with SQL state 08001 and server error 10060

Regards Hakit

I have the system working now with both Win 7 and XP Pro but not really happy with the fix. The SQL passwords seem to be stored in a different encryption for these 2 OS's If I change the password on the SQL server then let Win 7 rebuild it the system works ,, but you can't use that login on XP Pro without doing the same thing over again.

A:ODBC connection problem

Hakit, does your workaround work for users with windows authentication?
IF so can you step me through your method for resetting ?

Read other 3 answers

I have created a ODBC connection between MS Acceess 2003 and Excel 2003 in Windows 7 32bit enviroment . The Macro ( code ) is as follows :
ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
"ODBC;DSN=MS Access Database;DBQ=D:\Acces7dat\STOCKS.mdb;DefaultDir=D:\Acces7dat;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTim" _
), Array("eout=5;")), Destination:=Range("A1")) ... etc , transferring data from MS Access file stocks.mdb to an Excel spreadsheet for proccessing etc . All this works fine for the last three years until I have installed Windows 7 64 bit . Googling the problem found that I have to run the Windows/SysWOW64/obdcad32.exe file . Doing this appears the ODBC Data Source Admiinstrator with the tabs :
User DSN , System DSN , File DSN , Drivers , Tracing , Connection Pooling and About , and I can't configure all this in order to create a ODBC connection . First , is this the correct way to solve the problem and second how to setup the ODBC Data Source Admiinstrator under all these tabs ? Any help ? thanks in advance.
PS : I have reinstall Ms office 2003 in order to add missing items etc but no luck .

A:how to establish a ODBC connection in Windows 7 64 bit ?

the problem was solved by ODBC Data Source Admiinstrator , pressing the button " Add " and afterwards writing " MS Access 2003 " just right the DSN ( = Data Source Name ) label and OK , no matter should understand all of this .

thanks anyway

Read other 1 answers


We are moving an old Access project from XP too Windows 7 32 and .Net.

However there is something wrong with Windows 7! When I try and create an ODBC link via ODBC Administrator to allow the software to access data tables on SQL Server on the Windows 2003 Server it just keeps producing a message saying the TCP/IP port does not exist or access is denied.

Having tried the same experiment with an XP computer it worked fine, no issues, but Windows 7 strangely doesn't???

The SQL Server is on standard port 1433, I tried turning the firewall off in Windows 7 but that made no difference, when installing Windows 7 and connecting it too the network it complained it needed a DNS address so I put one on the server and set that in the Windows 7 client.

The XP client never needed one, could that be linked to this odd issue?

My first experience of Windows 7 this is and it seems like Microsoft have struck again by taking something that works and making it unnecessarily difficult...

Of course I could be wrong

Read other answers

I have recently updated my ODBC connection settings to my sql database, however when I open a word 2003 document to mailmerge it still tries to connect to the old database settings.
Is there a way to refresh the settings in the word document so that it acknowledges the changes?
Any help is much appreciated

A:ODBC Connection doesn't update when trying to mailmerge.

Hi Gortini. Welcome to the TSG Forums

I suggest that you ask a Moderator to move your post to "Software & Hardware, Business Applications" as you are more likely to get a reply there than in the Windows XP Forum.

Please do NOT post again. You must ask a Moderator to move the post.


Read other 2 answers

I have two laptops at my company that have Windows 7 Home - thus cannot login to AD/Domain as a specific user. They in-turn use a local administrative account setup on those laptops. We have a database setup with linked connections to our SQL Server 2005.

Whenever we're trying to access those linked tables we get the following error message:
We can bypass this issue by manually typing in the Login/Password within this error prompt.
What's strange is that we have ODBC setup to use the SQL Server Authentication:
That SHOULD allow us to not use Windows Authentication (as you can see it's trying to use the 'Guest' account on Windows 7. I've tried making this change through both x32 and x64 versions of ODBC (located in wow64). I've searched all over the internet concerning this issue but no one seems to have anything similar. This used to work a few weeks ago and I don't know of anything we changed other than a few system updates.

The SQL Server's Security is setup to use both authentication methods:
Our SQL Server gives us an Error: 18456, Severity: 14, State: 11
A quick Google search explains that State 11 means, "Valid login but server access failure".

Any help please? The only solution I have right now is to install W7 Pro...

A:Access & ODBC connection issue on W7 Home, State 11

Sound like a Windows permissions issue to see the SQL server.

You could also map a network drive using other credentials. This will authenticate the computer onto the domain.

Read other 4 answers


I have a problem with my connection. I'm on Vista x64 sp2. Yesterday I downloaded a program called EnhanceMyVista (to make taskbar icons like those on Win7) and then disabled some services in Optimization tab to make my startup run faster. But then, after restart, my broadband connection dissapeared! When I tried to make a new PPPOE connection i got an error: "the wizard cannot create the connection" ! In the EnhanceMyVista i clicked "Undo Changes" but nothing changed. also did system restore but nothing! The same when uninstalled the EnhMyVista program.
I did some googling on the issue and i think the problem might be in the RasMan service not starting - when i try to start the service in the services.msc i get the "the dependancy group or service failed to start - error 1068". This means that some dependencies that RasMan needs do not start? When trying to start the Secure Socket Tunneling Protocol (uopn which RasMan depends) I get "error 1717: Interface unknown"

Please help! thank you

A:Solved: the wizard cannot create the connection problem

Read other 16 answers

one desktop with cable modem connection + one wireless card
one laptop wireless

one complete day trying to make it work..manuals,google microsoft and nothing work for me
always said connected but is not working

any help ..any recommendations

sorry my english is bad

A:Solved: can't create internet connection sharing (frustating)

Read other 9 answers

Hi mates

i have a big job this 2 months so

i need to fix about 70 machines ,and that to remove Antivirus and install other antivirus but the problem if i need to remove Antivirus i need about 20 steps to uninstall it and clean registry........

so i think to create script to run it in all PCs .OR if are there any tools i can configure to run that automatically in all PCs

so you have any idea how can do that ???

many thanks

A:create script!!!

What AntiVirus utility do you use?

Norton (aka Symantec) has a Removal Tool for various versions (use link).

Maybe whatever you are using has something similar.

Read other 1 answers

I have written a software and i want to have an installer for it,it must do the following things.
1)Show a page with license
2)Check if JRE is installed or download and install.
3)Read a registry key and pass the value as a argument for a program.
4)Write a registry key
5)Create a uninstaller.
Can anyone create a NSIS script please plezzz.

Read other answers


Is it possible to write some sort of script/program to change IIS settings.

Here is what I want to do:
Every time I create a new site in IIS I want to create a new virtual directory under it. This virtual directory contains some asp files. Then I want to be able to automate the following for a couple of those asp files.
=> Right-click on filename
=> properties
=> file Security
=> Edit anonymous access and authentication control
=> Edit account used for anonymous access
=> change the username & tick Allow IIS to control password

Is there a way of doing this? I want to be able to supply a site name as a parameter to a script that then does all of the above.
Thanks in advance

A:A script to create a site in IIS?

There already is one in the admin interface for IIS.

Read other 2 answers

i guess it's the right place because it's w10 related

i would like to create a bat or small program or a script
1)hide the taskbar
2)run photoshop
3)unhide the taskbar

the tool i can use it's nirsoftware
to hide

nircmd.exe win hide class Shell_TrayWnd
after run photoshop and when i close photoshop
unhide the taskbar with

nircmd.exe win show class Shell_TrayWnd
i created this

nircmd.exe win hide class Shell_TrayWnd
nircmd.exe exec show "C:\Program Files\Adobe\Adobe Photoshop CC 2015\Photoshop.exe"
nircmd.exe waitprocess Photoshop.exe nircmd.exe win show class Shell_TrayWnd
it works but i got this


A:can you help me to create this bat script or program?

Correct me if i'm mistaken but isn't this what you're trying to do? I use the second setting anyway to do what I think you're trying to do.

"automatically hide the taskbar in desktop mode"


Read other 2 answers

Okay so I just got this program called Transparent Screen Lock and you can run files when the program starts/locks and closes/unlocks. What I would like to do is create a script or something that changes my desktop background to an image when I click "lock" and another script to change the desktop image when I "unlock".

Is there a simple script or BAT file or something someone could make that does this???

I would like to be able to modify it myself so it is the picture I would like to be selected. So all I would do is change the file directory of the image used on the background in the BAT file/script.

Also to go with this program I would like to add a shortcut to this menu here:

Regards, Radical924

A:How 2 create a script/BAT or something that changes my desktop image?

If someone knows how they will see your thread. It's only been two hours or so.

Read other 9 answers


We area school where all students have a computer. We would like each student to be local administrator on there own machines. I have manager to change the user to local admin when they log on, however, the weekness in my script is that anyone that logs on is automatically local admin for that machine, even if it not theirs. All machines have a common naming policy - H-BB-student name - so my question is:

How do I trimm the H-BB- and the compare the log on user name to the machine name:-

IF TRIM(machine_name) = user_name
MAKE user_name local_administrator

I hope that makes sence!

Any assistance greatly appreciated.


Read other answers

Hey guys,
We're trying to roll out an energy-savings initiative at my company that basically entails scheduling a task on all of our PCs to put them into hibernation at around 6:30p and wake them back up at 4:00a to run our nightly maintenance tasks. I've got the tasks working perfectly; the test machine goes to sleep and wakes back up without a hitch.

Problem is, now I have to go and do it on over 100 other PCs and it's going to get tedious fast. Is there a Microsoft tool or anything that will just run some sort of script to create pre-defined tasks?


A:Script to create scheduled tasks?

You could do it using a login script on the machines using the AT command:

The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
[ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername Specifies a remote computer. Commands are scheduled on the
local computer if this parameter is omitted.
id Is an identification number assigned to a scheduled
/delete Cancels a scheduled command. If id is omitted, all the
scheduled commands on the computer are canceled.
/yes Used with cancel all jobs command when no further
confirmation is desired.
time Specifies the time when command is to run.
/interactive Allows the job to interact with the desktop of the user
who is logged on at the time the job runs.
/every:date[,...] Runs the command on each specified day(s) of the week or
month. If date is omitted, the current day of the month
is assumed.
/next:date[,...] Runs the specified command on the next occurrence of the
day (for example, next Thursday). If date is omitted, the
current day of the month is assumed.
"command" Is the Windows NT command, or batch program to be run.
Click to expand...

Read other 1 answers

Hi,I tend to do the following alot:
Create multiple folders, give them specific names
open the folders, fill them with shortcuts to programs
change the names of the shortcuts
change the icons of the shortcuts

So I am wandering, is it possible to create a script to do the above?

1.) create several folders, give them different names
2.) fill the folders with shortcuts to programs having the correct names and icons

A:script - create folders containing shortcuts to programs

Copy the code below into a text file and rename the .txt extension to .vbs

Just change the "Create Folder Path" (line 2) to reflect where you want the destination folder to be created. Also change the Save Path and Link name in line 4 as well as the Target path of your application in line 5. Save the file and then double click to execute. You will need to refresh your desktop or directory by clicking F5 in order to show the newly created folder. In my example below I copied the file MSConfig.exe to the root of my C: drive and then used the script to create a shortcut to it inside the folder "Test" on my desktop. I'm not sure how to change the icons via code so maybe someone else could help out ??
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateFolder("C:\Documents and Settings\euza116\Desktop\Test")
Set objShell = WScript.CreateObject("WScript.Shell")
Set objShortCut = objShell.CreateShortcut("C:\Documents and Settings\euza116\Desktop\Test\Your_Link_Name.lnk")
objShortCut.TargetPath = "C:\MSConfig.exe"
objShortCut.Description = "Shortcut_to_ MSConfig"

Here is the same code in VBA Just change the path names to reflect the correct application and save paths. You can add this code to a module within MS Word or Excel or other MS Office Application.
Public Sub CreateDirectory()

Set objShell = CreateObject("WScript.Shell"... Read more

Read other 3 answers

Hello. I have a technical question/issue I wish to ask. I hope someone can help me.

I am looking help for someone to modify or rewrite for me a simple system registry script for my context menu that allows or forces to "run as administrator" privileges automatically when I click on the "Registry Editor" option in my Windows 7's desktop's context menu. I am not an expert with complex script writing. I need your help.

Here is a copy of my current working system registry script below that does NOT have administrator privileges that opens the Registry Editor in my Windows 7's Desktop's Windows Context Menu. It needs to be modified by being written or rewritten to automatically allow when executed as an administrator:

[HKEY_CLASSES_ROOT\Directory\Background\shell\Registry Editor]

[HKEY_CLASSES_ROOT\Directory\Background\shell\Registry Editor\command]


I have also attached the same code as above in TXT format below to this question for your simplicity so you can work with it here, on your Notepad, or default script editor; then save and attach back to me in your reply comment the working correct modified script.

For your information, this system registry script is for Windows 7 Professional 64-bit.

Please reply.

Thank you!

A:I Need Help To Create REG. Script With Admin. Priv. For Reg. Editor?

@ anyone:

Hello again. Would anyone wish to help me with this issue?

Please reply.

Thank you!

Read other 1 answers

I want to create a batch script which can search for .jpg and .jpeg

I am new to this script language, so don't no how to search, so I am posting this thread here.

Please can anyone tell me the batch script which can search all drives and folders and subfolders in a computer for .jpg and .jpeg, once found they must get copied.

Please help me with this, please give me the script code for this.

Read other answers

Hi everybody - My problem is that I have 100 identical printers, all the printers have network connectivity onboard.

I want to create 100 print queues for these printers, however I don't really want to add each lpr port/print queue manually !! Is there anyway that this can be done via script or batch file ??

Thanks in advance


Read other answers

I have a bunch of pdf files that are named "minutes.pdf", each alone within a directory that tells me what they are.

So the file path would be D:\WaterBoard\August2012\minutes.pdf

Every pdf is named "minutes.pdf" if this helps.

How would I create a batch file that would give the pdf a file name of the folder within which it is located? I've got like 400 of these so a script would be super useful. Thanks for any guidance!

A:Create Script to rename files after parent directory

There is a subforum on DonationCoder.com that does nothing but these small requests:
Post New Requests Here - DonationCoder.com

Please read the guidelines before posting.

Of course someone here may post a script or batch for you also.

Read other 1 answers


I'm having trouble creating a batch script to simply copy a shortcut to the desktop from a program installation, then carry out some tasks.

Overall my goals are:
Burn a CD that includes a autorun.inf that will load a batch script
In the script I want it to activate two self extraction archives
activate a self-extraction archive to install the necessary files to C:\Program Files (x86)\Software
2. (once 1. completes)
activate a self-extraction archive to install the necessary files to C:\Program Files (x86)\Software\Content

Then finally have the batch script create a shortcut from C:\Program Files (x86)\Software\Softwarename.exe

Any advice will be appreciated. thanks in advance..

A:Creating a batch script or use a 3rdpartyprogram to create shortcuts

Still looking for a solution!

Read other 4 answers

Wondering if anyone in this forum can help me figure out what I am doing wrong with my script. I am grabbing a text file with a list of users in it. I want to then create folders for all those people and then set explicit permissions on those folders to only allow the users and admin access to it. So for the create user folder, I have...

$Users = Get-Content "C:\Users.txt"
ForEach ($user in $users)
$newPath = Join-Path \\mycomputer\Users$ -childpath $user
New-Item $newPath -type directory

This works great as I now have 100 folders created. But how do I use something like....

$acl = Get-Acl "\\mycomputer\users$"
$permission = "mydomain\$users","FullControl","Allow"
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission
$acl | Set-Acl \\mycomputer\users$\$user

When I try to loop these together it says the folder already exists or the setaccessrule identity references could not be translated.

Anyone know how I loop it in with creating the folder? Or is there a way to just say...create folder based on this username, then take that username and make it the only admin on the folder along with the system admin??

A:powershell script to create user folders and set permissions

answered my own problem...but maybe someone can help me out from here. This works for creating folders and setting permissions.

$Users = Get-Content "C:\Users.txt"
ForEach ($user in $users)
$newPath = Join-Path "\\myserver\Users$" -childpath $user
New-Item $newPath -type directory

$acl = Get-Acl $newpath
$permission = "mydomain\$user","FullControl","Allow"
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission
$acl | Set-Acl $newpath

Anyone know how I would then look at an old server with user folders and do a stare and compare between the old and the new ones I just created? And once I find a folder that matches I want to grab all the contents in the old server and robocopy it over to the new server.

Read other 3 answers

Is there a script using 'net user' or similar to create a local administrator account including password for Windows 10? I tried to put something together but apparently missed a step or have one out of order.

The purpose is to give Users a way to create a 'backup' account to be used if they forget their password or any number of other problems that can prevent them from logging into their system; with their normal Microsoft Account.
Rather than walk them through each step over the phone, I could email them a script to be run before the problems happen It would create a local admin account with a specific password that could be used in emergencies.

This is for employees who have company systems but are seldom at the office and I would want to preload the name and password so they would not accidentally connect with it but it would be there and ready to use if they call for help.
Can this still be done in Windows 10 if all the steps are in the right place?

Read other answers


I have the following batch file that works great, until I happen to execute it on a file with a + in it.

@echo off
for /r %%f in (*txt) do copy %%f m:\text files

I searched around for a bit, but I couldn't get any of the information I found about escape characters to work. How can I make the batch file treat the file name in %%f as a literal?


A:Batch script to create files with special characters

Read other 10 answers

Hi to all,
I would like to create a powrshell script that will exectute a scheduled task on Windows 7 X64.I tried to find it on Internet without solving my problems.Please find below the description of what i want.
Purpose: Create Powershell script to run a scheduled task

What does the scheduled task do? Execute the following command when starting the PC: 

Regsvr32 /s C:\Windows\SysWOW64\oleacc.dll
with the system account of the machine concerned.This task is performed when the PC is restarted.
i'm a beginner in powershell.
THank you for your help.

Read other answers

I friend of mine uses windows 2000 and needs ODBC for a school project.

Thing is, it doesn't seem to exist in her control panel.

Do you have any ideas what may be the cause of that?

A:[Solved] ODBC missing

Read other 7 answers

Hi all. Does anyone know where a file is on a computer that stores data for ODBC connections. There has got to be a way to migrate these settings. I have looked at .dsn files, as well as the ODBC.ini file.

A:Solved: ODBC connections

Read other 7 answers

I was wondering if there was a way to create a set of folders in a specific directory according to a date range that i input.


Select start date 2011 10 01

select end date 2012 10 01

Select Output path of c:\users\XXXX\desktop\export data

and it creates a folder for all days from 2011 10 01 through 2012 10 01 and places them in the output path i have set for it.

any help would be greatly appreciated.

Thank you

A:Is there a Script or batch file that can create folders by date range

Welcome damjohnron to the windows 7 forums.

Here are some snippits of a dos batch file that will create a directory with the datek and tell you if it already exists.

set DATEST=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
echo %datest%
rem if it looks ok, then you can press enter to continue
if exist %homepath%\documents\%datest% goto dup1
md %homepath%\documents\%datest%
rem the pause can be taken out if you wish.
go to end
rem you already have done this.

you can change the path statement to the directory you wish.

This batch file can be run each day that you want to create a new sub directory.
There are other ways to do this but a bit more complicated such as reading an external
text file for the directory names.


Read other 4 answers

so im an IT specialist at a big car dealer ship im not that good with scripting but what i want to do is when i go around to a computer i want to be able to put a flash drive in run a batch script that creates a folder on the C drive transfers a few files (xml and .bat ) to that folder then from that folder i want to run the batch script that will create a scheduled task to run ccleaner when the pc is in idle for 10 min
we have 600+ pc's some are on the domain some are off the domain with various user names/passwords and pc names also different os's (xp win 7 and some vista) some are 32 bit but most are 64 bit

ok so i made a scheduled task on my pc then exported the XML i put the files on a flash drive then i made a batch to copy the other batch scripts/xml's to a folder on the c drive (that part im having no issue with )only issue i have is when i try to run the batch to make the task on a different pc then the one i created it on i get a message saying "error: no mapping between account names and security ID's was done <17,8>:logon type
i plan on just popping in the flash drive and running these scripts as i go around doing the preventive maintenance or wile im on a pc to troubleshoot an issue

here are my scripts

this one is run off the flash drive and creates a folder on the c drive i have no issues with that but im posting it just as a reference

@echo off
REM Check if 32 or 64-bit OS
if "%Processor_Architecture%"... Read more

A:creating a batch script to create a scedualed task on multiple pc's

Hi there,

Quote: Originally Posted by joeykong

only issue i have is when i try to run the batch to make the task on a different pc then the one i created it on i get a message saying "error: no mapping between account names and security ID's was done <17,8>:logon type

Is this the only issue?

It's not a problem with batch but with Task Scheduler. Before you can import a task that originated from another computer, data contained in the "UserId" element of the task xml has to be changed to match up with a user that exists on the machine you are importing the task to.


<Principal id="Author">
The part in red must be changed to one of the users of the machine you are trying to importing this task to.

Read other 2 answers

Hello again,

I am trying to creat a ODBC Data Source for my Access Database, so that I can see it in Open Office. I can't find the ODBC icon under the Control Panel however. Does anyone know where I can find it? I'm running Windows XP Professional SP2.


A:Solved: ODBC icon in Windows XP?

Found it. Sorry about the post.

Read other 2 answers

When I am testing an ASP page by Dreamwaever, I encountered an error about my IIS or PWS:

OLE DB Provider error for ODBC Drivers error 80004005
[Microsoft] [ODBC Driver Manager] Data Source Name not found and no default driver specified.

I went to the Knowledge Base at Microsoft site and pull out an article (190006).

My question is that my os happens to be Window 98II and their suggestion seem to be for WindowNT.

How to resolve this. Any help will be appreciated!!!

The following is an excerpt from the article:

The Global.asa file is not located in the root directory of the application.
To determine if a directory is designated as an application root and verify that it also contains the Global.asa file, perform the following steps:
1. In the Internet Service Manager (ISM), verify that the node is configured as an application.

To do this, verify that the node displays the package icon in the ISM. To further verify, view the property sheet for that node. On the Virtual Directory tab, under Application Settings, an active name should be listed for the application. If the name is "Default Application" and it appears dimmed, the node is NOT an application.
2. Verify that the Global.asa file is located in the root directory of the application.

To determine the root directory of the application, view the property sheet for the application. Check the Local Path setting on the Virtual Directory tab.

A:(Solved) ODBC 80004005 error

I would check out the info on Macromedia's site.




Read other 3 answers

I Have Recently Updated Xp With First Sp2 And Then Sp3. Now I Cannot Create A Dialup Connection.
When I Go To Wizard For New Conenction Only Broadband Option Is Selectable And The Other 2 Are Greyed Out.
The Modem Is Working Fine.
I Doubt This May Be Because Of Service Packs I Have Installed.
The Remote Access Connection Manager Service Couldn't Be Started ( Error 126 : The Specified Module Could Not Be Found )
Other Depending Services Like Telephony Are Running.
I Have Tried Deleting The 25,26 Registry Keys.
Also Deleted The Telephony Registry Key And Restarted But Still No Use.
I Have Also Tried After Uninstalling Sp3 But The Same Problem.
I Am Currently Using Broadband Connection.
But I Need Dialup Connection Too.

Help Needed Desperately.

Read other answers

I have an Access table linked to MSSQL. The table has a primary key with no additional indices. I receive write conflict errors when I attempt to update some records (not all) while in an access form or directly in the table via Access. Changes in SQL work fine. Very strange - some records can be changed, while others cannot, seemingly without any pattern related to position in the table or data contents. NO triggers exist in the DB. What is going on?

A:Solved: Access w/ ODBC MSSQL - Write Conflict

Read other 9 answers

Can anyone help me how to create a batch file or vbs script to install multiple windows patch (.exe) file from a network share folder. Also I want get the individual log file of all user including hostname.
So please help me because we need to deploy multiple patches in around 100 PC and we are not using any WSUS  server and windows automatic update.

Thanks & Regards
Rakesh Kumar

Rakesh Kumar

Read other answers


We are working on a domain migration and need to push out a VPN connection (L2TP with PSK) to some field users and set that connection to "Allow other people to use this connection" so that we can get connected prior to login. 
I was able to make an installer with CMAK which creates the VPN connection (which works) but I see no way to set "Allow other people to use this connection". I know in Windows 10 powershell I can do a set-VPNConnection but that wont work for the
Win7 and Win8 PCs (not sure about Win8). 
I've run CMAK on Win10 and Win2008r2 with no difference. 
Clients are Win7, Win8.1, and Windows 10.
1. Is there a better way to push a L2TP with a PSK to clients? I looked at GPO but that doesn't seem to have an option for PSK.
2. Is there a way to set "Allow other people to use this connection" post creation?
3. I noticed a difference with the phonebook file when creating it manually and tried to copy a phonebook file from a working PC to a test box with no luck. What if any is the right way to migrate this data if it can fix the issue?

Thank You

Read other answers

I got problems with trying to "Create a New COnnection" in the windows 2000, i guess XP and other window versions are similar. Trying to connect to my internet, to my school, but clicking on that has issues, i prob dont wanna get into the issue, so im just asking if there are FREE software out there that can do what Win2k's Making new connection" can do? Im not sure what you call that program exactly.. ..TCP, or PPP slip or something? Sorry, not much of a computer linguist. Or if the software is not free, name some at least. Been having a hard time trying to get online. Im using someone else's computer rigtt now.
edit: Basically, im just having problems connecting to the internet, I cant seem to go to the netwokring folder and then click on "Create a new connection", because whenever i fill in the blanks of the Wizard Connection-with the dial up phone number, name, type of conection, etc , some error shows up and doesnt let me finish up. So any programs out there than works the same way as this so i can connect to the net?

A:NEED: Software to replace Win2k's TCP/PPP COnnection thing "Create a new connection"

Read other 12 answers