Over 1 million tech questions and answers.

how to create a batch script for oracle odbc connection

Q: how to create a batch script for oracle odbc connection

Create a batch script for Oracle ODBC connection

Read other answers
RELEVANCY SCORE 200
Preferred Solution: how to create a batch script for oracle odbc connection

I recommend downloading and running Reimage. It's a computer repair tool that has been proven to identify and fix many Windows problems with a high level of success.

I've used it in the past to identify and fix everything from blue screens (BSOD's), ActiveX errors, corrupt files and processes, dll/exe/sys errors, recover lost memory, Windows update problems, defragging, malware removal etc.

You can download it direct from this link http://downloadreimage.com/download.php. (This link will automatically start a download of Reimage that you can save to your computer.)

RELEVANCY SCORE 103.6

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?
 

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
RELEVANCY SCORE 95.6

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
RELEVANCY SCORE 79.6

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

Read other answers
RELEVANCY SCORE 78.4

" 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:

http://publib.boulder.ibm.com/infoce...doc/odbc20.htm

Read other 2 answers
RELEVANCY SCORE 76.4

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
RELEVANCY SCORE 75.6

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

Ron
 

Read other answers
RELEVANCY SCORE 75.6

Hello!

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
1.
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
to
%userprofile%\Desktop\softwarename.ink

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
RELEVANCY SCORE 75.6

Hello,

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

@echo off
cls
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?

Thanks!
 

A:Batch script to create files with special characters

Read other 10 answers
RELEVANCY SCORE 74.8

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.

E.g.

Code:
<Principals>
<Principal id="Author">
<UserId>COMPUTERNAME\Username</UserId>
<LogonType>InteractiveToken</LogonType>
<RunLevel>LeastPrivilege</RunLevel>
</Principal>
</Principals>
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
RELEVANCY SCORE 74.8

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.

ie.

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
pause
if exist %homepath%\documents\%datest% goto dup1
md %homepath%\documents\%datest%
rem the pause can be taken out if you wish.
pause
go to end
:dup1
rem you already have done this.
pause
:end

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.

Rich

Read other 4 answers
RELEVANCY SCORE 72.4

We recently switched from Oracle 8 databases to Oracle 11g. I have an existing Access 2002 database with a report that runs off a schema in the Oracle database.

I created a new ODBC entry to link the tables in Access to the new Oracle DB, however I am getting an OBDC failure error when I try to link them in the link table manager.

Is there anything I need to do, download new drivers for example, to get the report to properly link to the tables?

Thanks!

Drew
 

A:Access - Oracle ODBC Error

Sorry, I have no idea, have you contacted the Oracle Support team or help?
 

Read other 1 answers
RELEVANCY SCORE 72.4

When I search for Oracle ODBC drivers, I can only find drivers for Windows 7. I have seen installation instructions for installing Oracle 11g on Windows 10 (the actual database software) but I can't find anything on installing Oracle 11g ODBC drivers (32 or 64bit) for either Windows 8.1 or Windows 10. I've also looked on Oracles "Instant Client downloads for Microsoft Windows (x64)", but only can seem to find ODBC drivers that work with Windows 7. What's taking so long? This would seems to be a rather highly requested driver.

Read other answers
RELEVANCY SCORE 72.4

Hi,
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
RELEVANCY SCORE 70.8

Good afternoon Lord Bob,

I have installed the Oracle 10 g drivers, but MS access 2007 x86 can't seem to see the ODBC driver. I tried to set up manually, but got a non administrator Fail answer. I am an administrator.

so what am I missing? I can see and connect using the SysWOW64 odbc driver, but the application can't,

thanks

sportsguy

A:For Lord Bob - installing Oracle 10G ODBC driver on windows 7 x 64

Not sure why you asked me this, and I have little experience with Access and Oracle software.

Have you checked the Access and Orcacle FAQs and forums for this problem?

~Lordbob

Read other 1 answers
RELEVANCY SCORE 63.6

I'm looking for a way to add an odbc link without having to type anything in, or at least as little as possible...

I'm using Windows XPe on the terminals in question.

I'd like to be able to just do it through a batch file, or to import it directly into the Registry, but I'm not sure of all the steps I need to take to be sure that it works properly.

Thanks for the help
 

Read other answers
RELEVANCY SCORE 62

I am having a problem with a batch script that prompts a user to enter a set of responses which then set variables - Then the script will call in another batch and writes the output to a new Batch file.

The problem is the batch file doesn't output the new Batch file the way I intended.

This is the script I have:

BEGIN.BAT

:START
@ECHO OFF
CLS
ECHO.
ECHO Please enter the full filename reference (e.g. 1-210208)
ECHO.
SET REFERENCE=
SET /P REFERENCE=
CLS
ECHO.
ECHO Please enter the full description (e.g. 12:15 on Thursday 21 FEBRUARY 2008)
ECHO.
SET Description=
SET /P Description=
CLS
ECHO.
ECHO Please enter the date reference (e.g. 210208)
ECHO.
SET DTE=
SET /P DTE=
CLS
ECHO.
ECHO Please enter the reservation slot time (e.g. 1215)
ECHO.
SET TME=
SET /P TME=
CLS
ECHO.
ECHO Please enter the script file you are replacing (e.g. 001)
ECHO.
SET Replace=
SET /P Replace=
CLS
ECHO.
ECHO Please enter the continuing script file (e.g. 002)
ECHO.
SET NxtFile=
SET /P NxtFile=
CALL "\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\ADMIN\TEMPLATE.CMD">"\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\DATES\%Replace%.BAT"
CLS
ECHO.
ECHO REPLACEMENT OF %Reference% completed!
PAUSE
GOTO START

TEMPLATE.BAT

ECHO @ECHO OFF
ECHO CLS
ECHO IF EXIST "\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\%REFERENCE%.TXT" (
ECHO GOTO NEXT
ECHO ) ELSE (
ECHO GOTO EXIST
ECHO )
ECHO :EXIST
ECHO ECHO.
ECHO ECHO %DESCRIPTION% IS AVAILABLE
E... Read more

A:Help with Batch script that creates a Batch script

Try This

Template.Bat
Code:

@ECHO OFF
CLS
IF EXIST "\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\%REFERENCE%.TXT " (
GOTO NEXT
) ELSE (
GOTO EXIST
)
:EXIST
ECHO.
ECHO %DESCRIPTION% IS AVAILABLE
ECHO.
ECHO Would you like to reserve this time?
ECHO.
ECHO Yes (Y) or No (N) or Cancel (C)
ECHO.
:ERROR
SET CHOICE=
SET /p CHOICE=Enter response to continue (Case sensitive):
IF not '%choice%'=='' set choice=%choice:~0,1%
IF '%choice%'=='Y' goto YES
IF '%choice%'=='N' goto NEXT
IF '%choice%'=='C' goto CANCEL
ECHO "%choice%" is not valid please try again
ECHO.
GOTO ERROR
:YES
ECHO %DESCRIPTION%>>"\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\ %REFERENCE%.TXT"
ECHO RESERVED BY %FullName%>>"\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\%REFERENCE%.TXT"
ECHO LOCATED ON %Team%>>"\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\%REFERENCE%.TXT"
ECHO STAFF ID IS %USERNAME%>>"\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\%REFERENCE%.TXT"
ECHO "%DATE%","%TIME%","%USERNAME%","%FullName%","%Team%","%DTE%","%TME%">>"\\hb eu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\LOG\AUDIT.CSV"
ECHO.
ECHO Thank you %FullName% - Your reservation has been successful.
ECHO.
PAUSE
:NEXT
CALL "\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\DATES\002.BAT&quo... Read more

Read other 3 answers
RELEVANCY SCORE 56.4

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
RELEVANCY SCORE 56.4

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
RELEVANCY SCORE 56

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?

max
 

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
RELEVANCY SCORE 56

Hi,

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
RELEVANCY SCORE 56

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
RELEVANCY SCORE 55.2

Hello,
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
RELEVANCY SCORE 54.4

Bonjour!

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
RELEVANCY SCORE 54.4

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.

T.
 

Read other 2 answers
RELEVANCY SCORE 54

Hi Ime Quite New here I Know A Little on Batch Scripts but i need Help Please

1.)How Can I Bypass UAC In Vista Without Restart In Batch Script
2.)How Do I delete All Files And Folders In My %TEMP% Without Confirmation
3.)How Can I Enter Text Into A Batch Script And Then Have The Script Save It As "info.ini"

Saved File Info.ini should read

Code:

[General]
Name= Entered Text
Model= Entered Text

[Support Information]
Line1= Entered Text

Any Help Or Just Point Me In the Rite Direction Please

Please

Thank you Mobile-latham
 

A:Help With A Batch Script Please

Ok Worked The delete %TEMP%
FOR /F %%A IN ('DIR /B /AD /S') DO RMDIR /S /Q %TEMP%\
 

Read other 2 answers
RELEVANCY SCORE 54

Hi, I just had a question about a script I'm trying to make for hiding/unhiding folders.

Here is the script I have come up with so far:

Code:
cls if exist "C:\Documents and Settings\Tom\Desktop\GM Games\folderlock\test" goto lock else goto unlock :lock echo off attrib "C:\Documents and Settings\Tom\Desktop\GM Games\folderlock\test" +s +h goto end :unlock echo off attrib "C:\Documents and Settings\Tom\Desktop\GM Games\folderlock\test" -s -h goto end :end exit

For some reason, it works to hide the folder, but when you click it after it hides the folder, it does not reveal the file again,
yet if I run the line "attrib "C:\Documents and Settings\Tom\Desktop\GM Games\folderlock\test" -s -h" in a separate batch file, it works fine...

Theres got to be something wrong with my script that is stopping it from running the "unlock" line...

Any ideas?
 

A:Need help with batch script

Read other 16 answers
RELEVANCY SCORE 54

Hi,
Can somebody assist me with a .bat file I am trying to create?
This is what I have now:


Code:
start /d "C:\Users\Me\Desktop\ghost" ghost.exe
start /d "C:\Users\Me\Desktop" Poweroff.exe

C:\Windows\System32\powercfg.exe /setactive e428f8a5-615e-488f-b7f7-1ed39450e522
The first 2 lines start programs on my desktop. The next line, I try to change the power setting so my computer won't go to sleep, but I am not sure how to put this in my script. When I enter the line in command prompt, it works, but I am new to writing batch files.

What I essentially want to do is to run those two programs and set my power settings to another profile.
The second program shuts down my computer when the first program ends. It would be nice if I could do this in a batch file without the second external program support. Another idea I had was to start up GHost.exe (1st program) and then run shutdown -t 20, but I also need help expressing this in a batch file, so the line runs only after GHost.exe ends.

Thanks for your input.

A:Help me with Batch script!

Oh boy, it's been several years since I did a lot of batch file commands...

Looks like you might want to add the start " " to that 3rd line, thats the 1st thing that comes to mind.

Read other 1 answers
RELEVANCY SCORE 54

dear all
any help to make batch script this the reason i want to make a batch file is to help me update the online games in 60 computers by overwriting or copying big files in one click from 1 source computer...
instead of turning on all 60 computers and updating all online games, he'll just have to update one computer and just copy the update or overwrite the old files in all 60 computers...

i have 1 server game i want only copy newer files to pc all pc client
example
pc server = 192.168.3.200
pc -01 = 192.1683.1
D\gameonline\dota2\
how to batch script

thx before

A:batch script help

i try to make script but no work
this my scripy

@echo off
set "pc_server=\\192.168.3.77\D\GameOnline\DOTA 2\"
set "pc-24=\\192.168.3.24\D\DOTA 2\"
robocopy /"%pc_server%/" /"%pc-24%/" /mir

Read other 6 answers
RELEVANCY SCORE 54

Hello All,

Greetings!

I am a BI guy.I need a batch script(.bat) for Winodws 7 enterprise edition.
My requirement:
I have some 100 files in a network drive which i can access.Each text file contains some 1000 records with some filed names.Now my question is i want to read those files and put result in another file.I dont want all the record of data in the text file. Now i need filename,record count,date of the file .

result file would be:
Filename record count date
Filename-1 100 01/dec/2017
filename-2 1000 01/dec/2017
filename-3 900 30/nov/2017. This i sthe data i need in a result file(like .csv,exel,.txt as result file)

At same time i have to increment automatically file when new file arrives into the directory.i,e i have executed file today i can see the files upto today.Tomorrow the file should run automatically and update the all files including history files....in the result text.This is because i use this file in a scheduled report in other technology where all these data to display.

I hope you understand.

Thanks in advance.
 

Read other answers
RELEVANCY SCORE 54

how can I start the service: "wireless zero configuration-service"
with a script or batch file?
witch code do I need?

OS Windows XP prof SP2

Thanx Mark
 

A:script or batch

Is it listed in the list of services in the services manager?
 

Read other 2 answers
RELEVANCY SCORE 54

Hi,

I have my vendor's ftp url over SSL. it's like ftps://myvendor.com and i have username and password. So please help me on writing batch script t o downlod the file from my vendor repository.
If this is not possible in dos script, please suggest me opensource tool. But i would love the solution in dos script as i need to use this forever to avoid any manual work.

Thanks

Read other answers
RELEVANCY SCORE 54

Hey im trying to create a batch script that will create the pattern for IP address's

I started with code that looked like

:loop1
set /a four="%four% + 1"
if ("%four%")==("9") goto loop2
echo %one%.%two%.%three%.00%four%
%cmd% >>"C:\%cmd%.txt"
if not ("%four%")==("9") goto loop1

:loop2
set /a four="%four% + 1"
if ("%four%")==("99") goto loop3
echo %one%.%two%.%three%.0%four%
%cmd% >>"C:\%cmd%.txt"
if not ("%four")==("99") goto loop2

:loop3
set /a four="%four% + 1"
if ("four")==("255") goto loop4
echo %one%.%two%.%three%.%four%
%cmd% >>"C:\%cmd%.txt"
if not ("%four%")==("255") goto loop3

which worked to an extent but once it hit loop3 it would continue adding to the next set of numbers and not reset itself back to 0.

how to i create a bunch of loops for creating the pattern for an ip address (000.000.000.000) from 0-255.

I read into the For /L command but wasnt successful at figuring it out.

Thanks

Read other answers
RELEVANCY SCORE 54

Hi,

I am trying to write a batch script, that will copy users "My Documents" Folder. I want to put a for loop in the script that will ping the computer first and if the ip address of the computer is in 10.10.10.0 to 10.10.10.200 range, then only it will prompt the user to copy enter user name, otherwise it will exit. This is what I got so far. It does the copy and prompt the user fine, but I don't know how to get the for or if loop working to decide only to do the backup for 10.10.10.0 to 10.10.10.200 range.
Code:

@echo off
Title "Back up My Documents"

ipconfig | find "IP Address" > ip.txt
for /F "tokens=* delims=:" %%I in (ip.txt) do GOTO copy

:Copy
start /wait NET USE /delete /Y z:
start /wait NET USE z: "\\servername"
set /p source="Enter your username: "
echo Please wait...Backing up My Documents...

If not exist "c:\Documents and settings\%source%" (echo You have entered wrong user name. Program will exit. Contact the admin. & pause & exit)

xcopy "c:\Documents and settings\%source%\My Documents\*.*" "z:\%source%\My Documents" /e /q /r /h /d /k /c /y /i

end if

start /wait NET USE /delete /Y z:
exit
Thanks for all the help
Jat421
 

A:Batch script

Read other 9 answers
RELEVANCY SCORE 54

I have a batch file I just need ran on and after certain days/dates.. these days vary.

So here is my question..

I want to create a file that I can put in the start up menu, so when my computer boots up it will run this file and check

the date. If the date is for example: november,18,2009 or later it will run the batch file.


That batch file is located in c:\Documents and settings\user\My Documents

So what kind of file would I need to create and what would the script be.

I need to be able to plug in different dates when I need to and using the schedule task in windows is not going to work.

Time doesnt matter just need dates.

A:Script or batch

Welcome to TSF!

This should do it. Set the target date in the 2nd line. Use the same format and symbols as your system does, so if your computer displays the date for Nov 18 as 18-11-2009, use that, not 11/18/2009.

Set the file name of your batch file in the 3rd line. The 4th line is the path to the file, which will be the My Documents folder of the logged on user. If you want this to run for more than one user, you'll need to change that as well, and put the batch file into a folder all users can read.

You can put this batch file in your Startup folder, or create a Scheduled Task to run this batch when you log on.

Code:
@Echo Off
Set _TargetDate=11/18/2009
Set _FileName=mybatch.bat
Set _Filepath=%Userprofile%\My Documents\%_Filepath%
:: Get todays date
Call :GetDate
Set _yy=%_fDate:~,4%
Set _mm=%_fDate:~4,2%
Set _dd=%_fDate:~6,2%
:: Convert todays date to Julian
Call :JDate %_yy% %_mm% %_dd%
Set _JToday=%_JDate%
:: Get Target Date
Call :GetDate %_TargetDate%
Set _yy=%_fDate:~,4%
Set _mm=%_fDate:~4,2%
Set _dd=%_fDate:~6,2%
:: Convert target date to Julian
Call :JDate %_yy% %_mm% %_dd%
If %_JToday% GEQ %_JDate% Start "" "%_Filepath%"
Goto :EOF

::===================================::
:: ::
:: - S u b r o u t i n e s - ::
:: ::
::===================================::
:JDate
:: Convert date to Julian
:: Arguments : YYYY MM DD
::... Read more

Read other 3 answers
RELEVANCY SCORE 54

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...
Thanks

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
RELEVANCY SCORE 53.6

How can I do a batch file that automate the archival storage operation with a batch file?

thank you,

[email protected]
 

Read other answers
RELEVANCY SCORE 53.6

I have a program that requires multiple steps to load (click on the icon then select the data folder ect...) I would like to write a batch file or script that would automate the process for the end users. Is there a good tool for doing this or examples of the code I could use???
 

A:Script/batch files

gtbwill,

Batch files are a lost art but they still work.
The following site has info on how to create different types of files: http://www.robvanderwoude.com/

Regards,
Roger
 

Read other 1 answers
RELEVANCY SCORE 53.6

Hi All,

I am writing a dos batch file for windows7 and it has many commands which need elevated access to run. For elevation I am using elevate.exe. I am doing like below -

set Elevation=elevate -wait cmd.exe /c
%Elevation% "cd /d %CD% && xcopy /E /Y ...."
%Elevation% "cd /d %CD% && command 2 .."
%Elevation% "cd /d %CD% && command 3 .."
%Elevation% "cd /d %CD% && command 4 .."
.....

My script calls elevate for cmd and then "cd /d %CD% for each command as elevate changes the working path to /system32 I am forced to change the directory every time I run elevate. It also prompts user for "UAC" dialog for each elevate command, so for ten such command UAC prompts will come 10 times . Commands I am using are mix of DOS command(like xcopy, diskpart etc) and some other 3rd party executable. So there is two problem for which I need some help-

1. How to call elevate for cmd.exe once and run rest of the command in same elevated console.
2. How to change working directory once instead with every command. I think solution to first one will take care of this also.

Any help is most welcome.

A:How to run cmd.exe elevated in batch script

Hi and welcome to SevenForums,

For batch files I run manually I set the shortcut for it to run as administrator and I get ONE UAC prompt.

I've never heard of elevate.exe

Read other 1 answers
RELEVANCY SCORE 53.6

Me and my friends are constantly plagued by Local Area Network connection issues when trying to connect to each other for streaming, game, etc. I was wondering how to create a file (like a batch file or script) that would execute the following commands to make the process quicker and easier to set computers up for a LAN.

- disable windows firewall
- disable/enable network adapters
- end unneeded processes such as ituneshelper.exe, ApplemMobileDeviceService.exe, etc.
- set computer's IP address to a specific static one (i.e. 192.168.1.10) as well as dns servers to particular settings

The whole point is to ease the process of connecting several computers on short notice in a short amount of time. I just need help learning how to write such a script or batch file or something that can execute all these things.

Thank you in advance for your help

A:batch file/script help!

a lot of those would probably be done via netsh
netsh /? for help
(I haven't played with this much, but I'm sure it's not too hard to figure out, you have to play with it a lot though)
for example http://social.technet.microsoft.com/...9-df9eb5700561 for windows firewall

tskill for ending processes

Read other 9 answers
RELEVANCY SCORE 53.6

Hi,

I have 1000 image url in my text file(sample.txt) and i want to download the images using the url. Can anyone please share with me the sample script which can do this in single shot.

Also, is there any way to reduce the size of the image into 20/20 px with png extension.

Thanks

A:Help Needed in Batch Script

hmmm im not very good with batch... but you can do this with wget.
your txt content is


Code:
www.pic.com/pic01.jpg
www.pic.com/pic02.jpg
right?

then get wget and use this command
wget -i sample.txt

and for resizing, get irfanview and use batch resize function.

Read other 4 answers
RELEVANCY SCORE 53.6

Well, I'm sitting here and can't this to work right.
Here's what I want to do:
- Login to a ftp server
- Download qconsole.log from demott
- Upload the same file to another folder at the remote server. (/logs)

Then the next thing:

I want then to upload this file from /logs to another FTP server, could anyone give me an example how to do that? Anyway here's my code:

Script.bat
Code:
FTP.EXE -s:SCRIPT.TXT

Script.txt:
Code:
open **.***.**.*** [COLOR=Red](IP)[/COLOR]
******** [COLOR=Red](USERNAME)[/COLOR]
******** [COLOR=Red](PASSWORD)[/COLOR]
lcd c:\logs
quote PASV
cd /demott
quote PASV
get qconsole.log
cd /demott/logs
quote PASV
put qconsole.log

 

A:Help with a Batch file script (FTP)

Hi mariusk,

Welcome to TSG !

You may adapt your script this way :
Code:
[SIZE=2]
open **.***.**.*** (IP)
******** (USERNAME)
******** (PASSWORD)
lcd c:\logs
quote PASV
cd /demott
quote PASV
get qconsole.log
cd /demott/logs
quote PASV
put qconsole.log
[COLOR=Red]close
open **.***.**.*** (NEW IP)
******** (USERNAME)
******** (PASSWORD)
lcd c:\logs
quote PASV
cd /logs
quote PASV
put qconsole.log
quit[/COLOR][/SIZE]

 

Read other 2 answers
RELEVANCY SCORE 53.6

I want to be able to run chkdsk on all my drives at start-up before much has loaded. It would appear I need to write or find a batch script file to carry out this task. I found the following script on a google search:[email protected] y|chkdsk c: /[email protected] y|chkdsk <next drive letter>: /[email protected] y|chkdsk <next drive letter>: /[email protected] y|chkdsk <next drive letter>: /[email protected] y|chkdsk <next drive letter>: /fetcetcThe | character is shift+backslash.This batch script is placed in the root of the boot drive (c: in my case) and executed via a shortcut from the desk top. The problem for me is that the script runs immediately, skips the c: drive but does offer the option of y/n to scan it at next boot, the script then goes on to check the other drives. There is no time delay after the skipping of the c: drive to select either y/n option and it does not check the drives at boot-up.Please could someone tell me how to alter the script or tell/show me an alternative method. The other thing is that I would like to be able to view a log of the scan/check.Cheers.

A:altering batch script

How many drives and what size are they?
Do you suspect that one of the drives might be failing?

I think that this will slow down the boot process dramatically & there really is no need to run chkdsk on startup unless you suspect a hard drive problem.

Read other 4 answers
RELEVANCY SCORE 53.6

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):
./Library/ODBC/odbc.ini
./Library/ODBC/odbcinst.ini
./Users/andynic/Library/ODBC/odbc.ini
./Users/andynic/Library/ODBC/odbcinst.ini
./usr/bin/iodbc-config
./usr/bin/iodbctest
./usr/bin/iodbctestw
./usr/lib/libiodbc.2.1.18.dylib
./usr/lib/libiodbc.2.dylib
./usr/lib/libiodbc.dylib
./usr/lib/libiodbcinst.2.1.18.dylib
./usr/lib/libiodbcinst.2.dylib
./usr/lib/libiodbcinst.dylib
./usr/lib/pkgconfig/libiodbc.pc
./usr/local/bin/myodbc-installer
./usr/local/lib/libmyodbc3S-5.1.5.so
./usr/local/lib/libmyodbc3S.la
./usr/local/lib/libmyodbc3S.so
./usr/local/li... Read more

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

Solution:
By using a combination of the information at
http://www.gyford.com/phil/writing/2004/06/07/installing_dbi_a.php
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.
Andynic
 

Read other 1 answers
RELEVANCY SCORE 53.2

Hello

I have made tables in oracle and im tryin g 2 connect these tables to java where i have made forms. i havent downloaded any driver but i think when i installed Oracle 8.1.7 it had jdbc drivers too. im tryin to run a separate code which checks the connection. It keeps giving an error saying that the" specified driver does not exist".
here is the code , hope somebody can help me

Code:


import java.sql.*;
import java.util.*;

public class MyConnection
{
Connection con;
MyConnection()
{
try
{

Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:Orahome","scott","tiger");

// ******************************Connected To Jdbc-Odbc Type - 1 Driver
/*
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// con = DriverManager.getConnection("Jdbc:Odbc:dsnname","userid","password");
con = DriverManager.getConnection("jdbc:odbc:Driver={SQL Server};Server=servername;Database=pubs","userid","password");
*/
// ******************************Connected To Ms-Access JDBC ODBC Driver .
/*
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("Jdbc:Odbc:dsnname","","");
// con = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb... Read more

Read other answers
RELEVANCY SCORE 52.8

Morning i have a problem with batch script in Windows 7.
this is my code:

Code:
@echo off
set mypath=c:\tools
if not exist "%mypath%\architet.txt" goto check3264
find /I "x64-based PC" "%mypath%\architet.txt" >nul 2>&1
if %errorlevel% EQU 0 (set architet=64) ELSE (set architet=32)
goto uacok
:check3264
echo Find Windows 7 32 or 64 Bit
systeminfo.exe >"%mypath%\architet.txt" 2>&1
find /I "x64-based PC" "%mypath%\architet.txt" >nul 2>&1
if %errorlevel% EQU 0 (
echo 64bit Found
set architet=64
echo Disable UAC
"%mypath%\file\hstart64.exe" /RUNAS "WScript //Nologo c:\tools\uac.js"
goto restart
) ELSE (
echo 32bit Found
set architet=32
echo Disable UAC
"%mypath%\file\hstart.exe" /RUNAS "WScript //Nologo c:\tools\uac.js"
goto restart
)
:uacok
rem find if pc is Eeetop 2010
if exist "%windir%\EeeTOP.scr" (
echo EeeTop ET2010 Found
echo Removing components
del /F /Q "%windir%\EeeTOP.scr"
wmic nic list brief >"%mypath%\net.txt"
type "%mypath%\net.txt" | findstr /I "ethernet 802.3" | findstr /v /I wireless >"%mypath%\net2.txt" 2>&1
For /f "tokens=3" %%F in (%mypath%\net2.txt) Do echo 000%%F>"%mypath%\id.txt" 2>&1
rem *1
For /f "tokens=*" %%G in (%mypath%\id.txt) Do set networkid=%%G
REG ADD "HKLM\SYSTEM\ControlSet001\Control\Class\{4D36E9... Read more

A:Problem with echo in batch script

this appen only in the batch.. if i cut the part and insert into another batch this work

Read other 4 answers