I have a script in box#1 (Win NT, env Ora 7.3.4)
d:\dir1\subdir1\script1.cmd
I want to add another script name using "call" in the last line of this script.But the script to be called is in box#2. The path is
d:\dir1\sdir1\script2.cmd (box#2, win 200o AS, Ora 817)
Logic is to map the box. Then call the script. After job successfully done then de-link. This happens everyday. How do I do this in Windows environment? I guess I should use "net use"
I'm assuming you have a "domain" setup to control security.
1) Create a share on a Box2 directory (Right-Click, Sharing . . .) careful with the permissions.
2) On Box1 include in the .bat:
net use X: \\Box2\sharename
call X:\my.cmd
net use X: /delete
To improve that, you could test on the existance of the .cmd file before trying to execute it and loop if not found (attempt to deal with Box2 or network down etc).
HTH
Last edited by DaPi; 03-19-2003 at 11:45 AM.
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
When you create the share you will have to give it a sharename - whatever you like as long as it's unique on the machine (by default it's the directory name). Just beware that default permissions are Everyone/FullControl ! ! !
X: is any unused drive letter on Box1 - you can't use D: because it already exists as a local drive on Box1. The net use creates a "virtual" drive on Box1 with a root wherever you created the share on Box2.
net use - without any parameters shows the current network mappings.
dir X: - will show you where the root is!
Additional warning - I suggest you experiment with a domain user that has rights on both boxes. If you start by setting up users in groups and giving permissions by group etc etc, you may do it perfectly correctly, but have the net use fail because the NT security stuff hasn't been replicated (if that's the right word) between the machines - this can take a LONG time.
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
Bookmarks