DirMake Failing

Started by geauga, September 02, 2014, 11:30:48 AM

Previous topic - Next topic

geauga

I have code that has been working for a long time but now is failing.  I am testing to see if a directory work on a remote server and if is does not I create it using DirMake.  In this case the remote server are still running Win 2003 so it is not a UAC.  I can manually create the folder  using Explorer from my PC to the server.  Below is a piece from the log file:


fulluserdir=StrCat(serverprefix, servernum,disk,userdir)
(15537) VALUE STRING => "\\cc-clctxpam53\c$\users\lachowk"

servername=StrCat(serverprefix, servernum)
(15537) VALUE STRING => "\\cc-clctxpam53"

BadServer=StrUpper(Strsub(servername, 3, -1))
(15537) VALUE STRING => "CC-CLCTXPAM53"

Display(1,Title01,StrCat("Setting Up Directory On ", BadServer, " for ", userdir))
(16567) VALUE INT => 0

If DirExist(fulluserdir)==@FALSE Then dir_added=StrCat(dir_added, servername, " ")
(17831) ==>TRUE=> "\\cc-clctxpam53 "

If DirExist(fulluserdir)==@FALSE Then DirMake(fulluserdir)
(29687) ==>TRUE=> 0

TERMINAL WIL ERROR=>1029 (DirMake: Dir not created)

Anybody have an idea where to look?

td

The OS version on the remote server has little or no influence on whether or not UAC is causing your problem.   Also, leaving out important information that WinBatch adds to the DebugTrace log file makes the DebugTrace output less the useful.

So we need to ask:

  • Which version of Windows is the script running on?
  • Is UAC enabled on the system running the script?
  • Is the script running as an elevated admin, restricted admin, or standard user?
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

geauga

I have tried running the scripts on Win7, Win 2003 and Win 2008 all to now avail.  UAC is not enabled in the Win 7 or win 2008 box.  The scripts is running as an elevated admin.

td

It is easy enough to test using the conditions exactly as you describe.  In that test the function was able to successfully create a new folder.   The only two common causes of failure are either a bad path or a lack of permissions.  Best advice is to check your assumptions again.

As a reality check you can always try using COM Automation to create your directory:

Code (winbatch) Select

objShell = CreateObject("Shell.Application")
objShare = objShell.NameSpace('\\<server>\<sharename>')
objShare.NewFolder("Temp")
objShare = 0
objShell = 0
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade