Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start File in Dos-Shell

Status
Not open for further replies.

innu

Programmer
Jun 13, 2001
40
AT
Hi!

Does somebody know how to execute sth. from the dosshell?

I only want to start a dts file on the server, so I've to give this file the final kick ;-)

Don't ask why I have to start it from dos-shell. It's really the only way, where it works.

Who has an idea?
 
Hey Innu,

I would try using <cfexecute> for anything that needs to be started from DOS.

<CFEXECUTE NAME=&quot;program.exe&quot; ARGUMENTS=&quot;CommandLine Arguments&quot;>

Just replace &quot;program.exe&quot; with the full path to the executable and put your command line arguments in place of &quot;CommandLine Arguments&quot;. If you don't have any arguments, just leave the &quot;arguments&quot; attribute out.

Hope this helps,
GJ
 
thx, I tried it, but my problem is very heavy.

The Database Server and the File are not on the same machine.

I've a DTS-Package, which is on the Database machine and a .bat-file on the other machine. If I start the .bat-file from dos-shell, it makes, what I would like, if I start it through a cf-file, it doesn't work.

I go crazy!!!

What's the matter?
 
Hey Innu,

It sounds like either a permissions problem or a mapping problem. If you are logged into the server running CF, do you have a drive mapped to the other machine so that CF can access the remote machine or is this unnecessary? Also, is CF set to run under an account that has permission to run the script against the db server?

It would also help if you could post the .bat file as they may give me a clue as to what's wrong.

Good luck,
GJ
 
oh, thx!

But I have just found my problem. It only works, if the database machine maps to the cf-machine. I did this, and now it works.

But it's not very clever, because so I have a little security problem, when the database server maps to the cf-server.

What do you think?
 
Hey innu,

Are you saying that the db server has to map a drive to the CF server? It seems like it's usually the other way around when CF needs to access something remotely. If it's the CF server that needs to map a drive, you could always put a &quot;net use&quot; command inside the bat file which can map and unmap a drive when it runs. Another alternative is to setup CF to run under an account that can map the drive and then setup a mapping that CF will use when it runs. This is a little trickier so let me know what you think will work best for you.

GJ
 
Hi GJ!

oh, it was my mistake. Sure, I map from the cf-server to the db-server :)

My problem was, that the domain of the db-server and the cf-server are not at the moment in the same domain, so Ihad to map from the cf-server to the db-server.

But, if the cf-server crashs, then I've to map again, thats my problem, solong, the db-server is not in the same domain. I hope we'll get the db-server soon in the same domain, then we'll not have problem like this.

But thank you for your help! You are good!

sl,
Innu
 
Hey Innu,

Glad I can help. It sounds like your best bet is to try and map it in the bat file with the &quot;net use&quot; commands for the moment.

Take care,
GJ
 
GJ can you direct me more info about creating batch files? I know the basics from years of dos, but id love to hear about any resources you have.

thanks
 
Hey Stran,

I've always meant to learn more about them but .bat files have always been one of my weaknesses. I did find a quick reference that might help though. If you find anything better, let me know as I could use it :)

GJ

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top