473,800 Members | 3,007 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to use a batch file to run a DTS program

1 New Member
Hello

I am trying to use a batch file to run a DTS program that I had created. Below is the Batch File code:


REM Type: Batch File
REM Created by: Raakish
REM Contact: raakish22@gmail .com
REM Import all excel files to SQL Server using DTS


REM Export DIR listing to E:\ArchiveTest\ uploadtest\Dirl ist.txt
dir E:\ArchiveTest\ uploadtest\csv1 3995\*.csv /b > E:\ArchiveTest\ uploadtest\Dirl ist.txt


pause

REM Execute DTS package for every file name in the Dirlist.txt

for /f "tokens=1,2 ,3" %%i in (E:\ArchiveTest \uploadtest\Dir list.txt)
do "C:\Program Files\Microsoft SQL Server\80\Tools \Bin\DTSrun.exe " -S"SQL"
-N"E:\ArchiveTes t\uploadtest\My Import2.dts"-A"ServerName "=
"local" -A"FileName"="E: \ArchiveTest\up loadtest\%%i" -A"DatabaseName" ="ALUMNI"



pause

REM Rename all the files with "old" as suffix
ren E:\ArchiveTest\ uploadtest\csv1 3995\*.csv *.csvold

The section that I am having trouble with is the for:

/f "tokens=1,2 ,3" %%i in (E:\ArchiveTest \uploadtest\Dir list.txt)
do "C:\Program Files\Microsoft SQL Server\80\Tools \Bin\DTSrun.exe " -S"SQL"
-N"E:\ArchiveTes t\uploadtest\My Import2.dts"-A"ServerName "=
"local" -A"FileName"="E: \ArchiveTest\up loadtest\%%i" -A"DatabaseName" ="ALUMNI"

Everything else seems to be working fine before that for loop is invoked..please help..
May 2 '07 #1
0 2663

Sign in to post your reply or Sign up for a free account.

Similar topics

2
9920
by: brad | last post by:
I am new to perl and would like to know how to check the return values of a perl program in a batch file. how can I save the return value of the perl program and use it to make decisions as to what I should do next in the batch file?
5
7044
by: Patrice FRITSCH | last post by:
I'm trying to run a batch file from an asp page using WScript.Shell object. Dim oWSH set oWSH= Server.CreateObject("WScript.Shell") call oWSH.Run("cmd.exe /c " & szCmd , 0, true) szCmd contains the program to execute (fop.bat with several parameters). But I'm getting the following error message :
0
2278
by: Leo Heska | last post by:
Hi I haven't seen the following problem mentioned anywhere We have an application written in VB.NET which executes a batch file (named startJob.cmd). We have discovered that if that batch file is too big, the last lines of the batch file will not run. For example, the following one-line batch file runs just fine when invoked from our VB.NET app echo %PATH% > c:\com\molex\plot\wmIntegration\logs\p0.lo but the following batch file...
4
2463
by: Z0gS | last post by:
I use the following code to run a batch file on the server side but it not working. The code is working fine on a c# window console program. Can anyone help me? Process myProcess = new Process() myProcess.StartInfo.FileName = "C:\\mapDrv.bat" myProcess.StartInfo.CreateNoWindow = true myProcess.Start();
0
1016
by: Roger Twomey | last post by:
I have an application that must use sftp to put files onto another server. To do that we have to build a script file with the commands to execute, then execute the sftp program telling it to use our command file. It APPEARS that the batch file executes (the files do get put onto the server according to the admin at the remote site) but the batch file never seems to end and it does not complete updating the log file. (We create a new log...
4
2663
by: | last post by:
Hello, I am attempting to convert multiple .wav files to the .flac format via a batch script. I know that this can be done with numerous software implementations automatically for me; however, i am interested to understand how to create a script to perform my purpose and since this function is useful, what the hey! I am rather new to batch files but would appreciate any help. TIA My process thus far has been the following: I edited the...
5
7670
by: sjayaramit | last post by:
hello friends, Is it possible to run a C program from a batch file. I use Dev c/c++ compiler and store the program in devc++/programs/examples/myprogram/one.c
14
12832
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In my windows applicationm, i need to excute a batch file. this batch file throws some text and questions to the screen, i need to catch the standard Output, check if it's a question, in case it's a question, i want to popup a messageBox or something, and bring back to the batch file the result (Yes\No question). I know how to excute the batch file and get all the Standard output at the end, but i don't know who can i read it line by...
7
2089
by: FireImp | last post by:
So I've read a lot of post about how to run a batch file from within the C# program. And I followed the instructions with a few alterations to fit my needs. First I am using cmd.exe to actually run the script because I want to take advantage of the /K option, so that the log will be onscreen. And second the batch file must be able to call other batch files in a cascading effect. Which it isn't able to do. So when I run the follow...
0
9694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10281
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10256
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10039
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9095
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5477
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4152
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2953
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.