General discussion

  • Creator
    Topic
  • #2104240

    NT 4.0 Server–Should be simple, but…

    Locked

    by eb4free ·

    Situation:

    I have a batch file which copies files into a folder, zips the folder, and transfers the zipped file to another location. This all takes place on an NT 4.0 server. Simple, right?

    Problem:

    This batch file works like a charm whenI run it manually. Since I don’t want to run manually every night, I use the AT command to schedule the batch file to run automatically each night. With the AT command, however, the resulting ZIP file invariably ends up in my C:\WINNT\SYSTEM32 directory–which is NOT where I want the file–no matter what I do.

    Question:

    How do I control the location where the output file will be sent with the AT command?

All Comments

  • Author
    Replies
    • #3794935

      NT 4.0 Server–Should be simple, but…

      by Anonymous ·

      In reply to NT 4.0 Server–Should be simple, but…

      I know there are probably other ways to do that, but I map a drive to my output folder,
      then copy files to that drive. Use the
      net use command in your bat file.

      Type in net use /? at the command prompt for
      syntax.

      Like I said, I know there’s got to be other ways to do this, but this works for me. I
      use a bat file with the AT scheduler that
      copies updated virus definitions to all of
      our remote sites once a week.

      Good luck.

    • #3794869

      NT 4.0 Server–Should be simple, but…

      by beermonster ·

      In reply to NT 4.0 Server–Should be simple, but…

      I could be wrong, but it sounds to me as if your script is CREATING the zip file in system32, then it’s the subsequent copy thats failing. When you start your script from the scheduler, I think you’ll find that the working directory is system32 (IE where cmd and command.com are stored), this means that were you to use syntax such as –

      myzipapp -addfiletozip myzipfile.zip c:\path\filestozip

      then as no path is outlined for your zipfile, it will be created in the working directory. As for why it is not subsequently copied, that is more than likely because the schedule service runs as localsystem, and localsystem has no rights to access the destination (esp if it’s across the network). Hope I’m on the right track…

      • #3725747

        NT 4.0 Server–Should be simple, but…

        by eb4free ·

        In reply to NT 4.0 Server–Should be simple, but…

        Close enough! You put me on the right track! In the batch file, I had not defined the working directory for the zip command line. (Duhhh!) I added the path where I wanted filename.zip to be created and it worked. If it was a snake it would havebitten me! Thanks!

    • #3758275

      NT 4.0 Server–Should be simple, but…

      by rudolph(uk) ·

      In reply to NT 4.0 Server–Should be simple, but…

      Create a network share where you want to have the zippped files and then try using the entire UNC path even if you are in the local computer:
      AT \\mycomputer /interactive /every:M,T,W,Th,F “\\mycomputer\share\zipapp.bat”

      • #3725748

        NT 4.0 Server–Should be simple, but…

        by eb4free ·

        In reply to NT 4.0 Server–Should be simple, but…

        Thanks for the response, but this wasn’t the solution that I was looking for. The problem was with the batch file, not the AT command. I agree with your syntax, except that the UNC isn’t needed since the file is already on the local server.

    • #3725422

      NT 4.0 Server–Should be simple, but…

      by dbowlin ·

      In reply to NT 4.0 Server–Should be simple, but…

      Why not just add another copy command at the end of your batch file to move the file out of your system directory to the desired location?

      • #3725749

        NT 4.0 Server–Should be simple, but…

        by eb4free ·

        In reply to NT 4.0 Server–Should be simple, but…

        Thanks for the response, but this wasn’t the solution that I was looking for. The file gets VERY large and takes up precious space on my system partition. Not a good idea to even have it land there.

    • #3759013

      NT 4.0 Server–Should be simple, but…

      by vh_s ·

      In reply to NT 4.0 Server–Should be simple, but…

      Hi,

      Quite interesting.

      I wonder whether you have defined your permission correctly ?? Since, whenever you run it manually it works, means that you logged on as Administrator which have almost the “Full Control” right everywhere on the disk (no restriction at all).

      Yet, the AT command is run under SYSTEM (see your Control Panel>Service>Task Scheduler). So, whenever you want to place a file on a certain directory, make sure that you give the SYSTEM at least the “Add” or “Change” PERMISSION on THAT DIRECTORY.

      You could change the AT command to log on as an Administrator, by redefining
      Control Panel > Services > Task Scheduler

      then define:
      Log on as Administrator (with the proper password).

      If it doesn’t work, please provide more information, for example you AT command, or your batch file ?

      Hope it help.

      • #3725750

        NT 4.0 Server–Should be simple, but…

        by eb4free ·

        In reply to NT 4.0 Server–Should be simple, but…

        Thanks for the response, but this wasn’t the solution that I was looking for. It was not a permissions issue.

    • #3725745

      NT 4.0 Server–Should be simple, but…

      by eb4free ·

      In reply to NT 4.0 Server–Should be simple, but…

      This question was closed by the author

Viewing 5 reply threads