Jump to content

Recommended Posts

Posted

So I have a very simple Auotit script that is utilizing the Printbrm to export to a file but Cacls are not being changed......

Attached is the script:

$sUser = "WTF"
$sPass = "IsGoing"
$sDomain = "OnHere"
$sCMD = "C:\Windows\System32\spool\tools\Printbrm.exe /b /f C:\temp\Printers\backup.printerExport"
$sCalc = "C:\Windows\System32\cacls C:\temp\Printers /t /e /g Everyone:f"

DirCreate ("C:\Temp\Printers")
RunAsWait ($sUser, $sDomain, $sPass, 0, "cmd /c " & $sCalc)
RunAsWait ($sUser, $sDomain, $sPass, 0, "cmd /c " & $sCMD)

 

Please any help will be grateful......

THANKS

Posted
On 3/5/2013 at 10:36 AM, water said:

Add

#RequireAdmin

at the top of your script and use Run to execute Cacls.

So I have a very simple Auotit script that is utilizing the Printbrm to export to a file but Cacls are not being changed......

Attached is the script:

$sUser = "WTF"
$sPass = "IsGoing"
$sDomain = "OnHere"
$sCMD = "C:\Windows\System32\spool\tools\Printbrm.exe /b /f C:\temp\Printers\backup.printerExport"
$sCalc = "C:\Windows\System32\cacls C:\temp\Printers /t /e /g Everyone:f"

DirCreate ("C:\Temp\Printers")
RunAsWait ($sUser, $sDomain, $sPass, 0, "cmd /c " & $sCalc)
RunAsWait ($sUser, $sDomain, $sPass, 0, "cmd /c " & $sCMD)

 

Posted

So I have a very simple Auotit script that is utilizing the Printbrm to export to a file but Cacls are not being changed......

Attached is the script:

$sUser = "WTF"
$sPass = "IsGoing"
$sDomain = "OnHere"
$sCMD = "C:\Windows\System32\spool\tools\Printbrm.exe /b /f C:\temp\Printers\backup.printerExport"
$sCalc = "C:\Windows\System32\cacls C:\temp\Printers /t /e /g Everyone:f"

DirCreate ("C:\Temp\Printers")
RunAsWait ($sUser, $sDomain, $sPass, 0, "cmd /c " & $sCalc)
RunAsWait ($sUser, $sDomain, $sPass, 0, "cmd /c " & $sCMD)

Posted

So I have a very simple Auotit script that is utilizing the Printbrm to export to a file but Cacls are not being changed......

Attached is the script:

$sUser = "WTF"
$sPass = "IsGoing"
$sDomain = "OnHere"
$sCMD = "C:\Windows\System32\spool\tools\Printbrm.exe /b /f C:\temp\Printers\backup.printerExport"
$sCalc = "C:\Windows\System32\cacls C:\temp\Printers /t /e /g Everyone:f"

DirCreate ("C:\Temp\Printers")
RunAsWait ($sUser, $sDomain, $sPass, 0, "cmd /c " & $sCalc)
RunAsWait ($sUser, $sDomain, $sPass, 0, "cmd /c " & $sCMD)

Posted (edited)

Why did you create another exact same thread?

EDIT: is this for 2003 sp2 or Vista+? If it is they say you should use icacls instead.

Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted

When I attempted the first time it said that the service wasn't available at the time.

So I created a new one and they both appeared. Couldn't find a why to delete it.

Posted (edited)

Ok np.

Did you try any combination of single or double quotes on the paths?

PS: and running as admin?

Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted

I have tried so many variables I can not recall......

$sUser = "WTF", $sPass = "IsGoing", $sDomain = "OnHere"

I am passing the cred to elevate to admin. 

The export of the printer is working fine however the Cacls are not changing as expected......
If I runas an admin and pass the arguements "C:\Windows\System32\cacls.exe C:\temp\Printers /t /e /g Everyone:f" It works fine

$sUser = "WTF"
$sPass = "IsGoing"
$sDomain = "OnHere"
$sCMD = "C:\Windows\System32\spool\tools\Printbrm.exe /b /f C:\temp\Printers\backup.printerExport"
$sCalc = "C:\Windows\System32\cacls.exe C:\temp\Printers /t /e /g Everyone:f"

DirCreate ("C:\Temp\Printers")
RunAsWait ($sUser, $sDomain, $sPass, 0, "cmd /c " & $sCalc)
RunAsWait ($sUser, $sDomain, $sPass, 0, "cmd /c " & $sCMD)

 

Test3.au3

Posted

I was thinking of something like this:

;untested
$iRtn = RunAsWait ($sUser, $sDomain, $sPass, 0, "cmd /c " & $sCalc)
ConsoleWrite("Return Value: " & $iRtn & @CRLF & "@error Value: " & @error)

 

That article I linked to has some info in regards to RunAsWait not doing automatic process elevation.

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
  • Recently Browsing   0 members

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