September 12, 2003 at 7:14 am
I should probably know how to do this without asking for help, but how do I call a DOS Copy command from an ActiveX vbscript within a DTS package?
xp_cmdshell?????
Please help.
Thanks,
Karen
karen M Mason
Karen M Mason
September 12, 2003 at 8:08 am
Have you tried to work on FileSystemObjects?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsmthcopyfile.asp
September 12, 2003 at 8:45 am
quote:
Have you tried to work on FileSystemObjects?http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsmthcopyfile.asp
Yes, I used FileSystemObjects to create a sequence of three files. Now I need to concatenate these three files into one output file. I don't think the FSO CopyFile command will support concatenation, but I'm not sure. Do you know?
Thanks so much for responding!
Karen
Karen M Mason
Karen M Mason
September 12, 2003 at 8:53 am
Maybe you could try to create the new file and append the content of another three files into the new file.
Maybe some VB Guru can follow up this.
Edited by - allen_cui on 09/12/2003 08:54:05 AM
September 12, 2003 at 9:15 pm
Can't remember if you can shell from VBScript. Could always do it via xp_cmdshell - just pass 'copy file1 + file2 file3', I think is the syntax.
Andy
September 14, 2003 at 6:14 pm
If you want to execute a DOS command in VBScript you need to create a Windows Shell object. Then you can execute any command you want.
Eg:
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("calc")
If you're not interested in any return value, just leave out the Set oExec from the above example.
As you are creating these files using the FileSystemObject, why don't you create the concatenated file while you're creating the other three?
Hope this helps
Phill Carter
--------------------
Colt 45 - the original point and click interface
Edited by - phillcart on 09/14/2003 6:16:55 PM
--------------------
Colt 45 - the original point and click interface
September 15, 2003 at 5:18 am
Thanks Phil, I shoulda remembered that! A nice side affect of that shell is you can shell and continue, or shell and wait. Nice to be able to easily control the behavior.
Andy
September 15, 2003 at 8:00 am
quote:
If you want to execute a DOS command in VBScript you need to create a Windows Shell object. Then you can execute any command you want.Eg:
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("calc")
If you're not interested in any return value, just leave out the Set oExec from the above example.
Thanks for the pointer to Wscript. I read about this prior to posting but surmised that a
little knowledge could be dangerous in my hands. Now that you've suggested using it, I'll investigate further.
quote:
As you are creating these files using the FileSystemObject, why don't you create the concatenated file while you're creating the other three?
Hope this helps
Phill Carter
--------------------
Colt 45 - the original point and click interface
Edited by - phillcart on 09/14/2003 6:16:55 PM
Concatenation of multiple files was a bandaid for yet another problem I couldn't resolve.
You're right. I should create the output file while creating the others. I've struggled with this DTS package for so long that I'm not approaching the task very logically anymore.
Yet again, you've set me on the right track.
Thanks much
BTW: I don't understand any of those Irish jokes
Karen M Mason
Karen M Mason
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply