Jump to content

Syntax issue with DfsUtil in DOS


PnoT
 Share

Recommended Posts

I've tried this so many ways my head is hurting. Could someone point me in the right direction as to why this code is not working properly?

Run(@ComSpec & " /c " & 'dfsutil.exe /root:\\sample.com\ud$ /export:c:\temp\Namespace.txt',"",@SW_HIDE)
Link to comment
Share on other sites

I've tried this so many ways my head is hurting. Could someone point me in the right direction as to why this code is not working properly?

Run(@ComSpec & " /c " & 'dfsutil.exe /root:\\sample.com\ud$ /export:c:\temp\Namespace.txt',"",@SW_HIDE)
You didn't say how it failed, but you may have to fully path out the dfsutil.exe file, and you should provide the working directory. The examples I see have no path on the export file, so it is presumably saved in the current working directory by default at least.

You'll get more info running it visible and leaving the shell open to read any errors:

Run(@ComSpec & " /k C:\MyUtils\dfsutil.exe /root:\\sample.com\ud$ /export:Namespace.txt", "C:\MyUtils", @SW_SHOW)

>_<

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You didn't say how it failed, but you may have to fully path out the dfsutil.exe file, and you should provide the working directory. The examples I see have no path on the export file, so it is presumably saved in the current working directory by default at least.

You'll get more info running it visible and leaving the shell open to read any errors:

Run(@ComSpec & " /k C:\MyUtils\dfsutil.exe /root:\\sample.com\ud$ /export:Namespace.txt", "C:\MyUtils", @SW_SHOW)

>_<

I can never get the dos window that AutoIT spawns to issue the command to stay open for viewing. It closes immediately and I've had that problem on any script I've ever ran that referenced a dos command. What am i doing wrong for the window to close like it does?
Link to comment
Share on other sites

I just figured out what was going on and why all my dos windows were not staying up when needed and the commands were not running.

My system32 folder on my machine had its rights changed probably due to me having some problems a month or so ago. The permissions on the utils i was trying to run were not visible from dos and did not have full control for admins set.

Thanks for the help and I was able to kill 2 birds with one stone this trip =-)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...