Win NT mapping scripts between boxes
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Win NT mapping scripts between boxes

  1. #1
    Join Date
    Oct 2000
    Posts
    449

    Win NT mapping scripts between boxes

    Hello DBA's:

    A question on calling scripts between 2 NT boxes

    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"

    Thanks, ST2000

  2. #2
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    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 12:45 PM.
    "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

  3. #3
    Join Date
    Oct 2000
    Posts
    449
    Thanks DaPi.. I am unclear about sharename..

    So I would be doing like this.. (After making the drive shareable on box#2)

    The end of script1.cmd..
    net use x: \\box2\sdir1
    call x:\script2.cmd
    net use x: /delete

    Can I simply use x: or should I use as d:

    Shall I post the exact file names and path as is?

    Thanks again.. ST2000

  4. #4
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width