Jump to content

pls help me , Convert a batch file commands into AutoIt?


 Share

Recommended Posts

Hi,

Anyone can help me converting the following batch file commands into AutoIt commands?
Regards

file .bat

TAKEOWN /f "%SystemRoot%\Media\Windows Navigation Start.wav" /a
CACLS "%SystemRoot%\Media\Windows Navigation Start.wav" /E /G Administrators:F
DEL /Q "%SystemRoot%\Media\Windows Navigation Start.wav"

pls help me converting --> .Au3 (autoit)

Link to comment
Share on other sites

Welcome to AutoIt and the forum!

Only "Del" can be changed to "FileDelete".

The rest needs to be executed by using "Run".

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Can you post what you have tried so far?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Here (Macro Reference) you can find a list of macros to replace the DOS macros (%SYSTEMROO% etc.) with.

Run(@Systemdir & '\TAKEOWN.exe /f ' & @SystemDir & '"\Media\Windows Navigation Start.wav"' & ' /a')

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Here is quite a different way to do it. Environmental Variables will be expanded like in a command script. && runs the next command if the previous command was successful.

Opt('ExpandEnvStrings', 1)
RunWait('"%ComSpec%" /c ' & _
    'TAKEOWN.exe /f "%SystemRoot%\Media\Windows Navigation Start.wav" && ' & _
    'CACLS.exe "%SystemRoot%\Media\Windows Navigation Start.wav" /E /G Administrators:F && ' & _
    'DEL.exe /Q "%SystemRoot%\Media\Windows Navigation Start.wav"' _
    , @SystemDir, @SW_HIDE _
)
Opt('ExpandEnvStrings', 0)

For those who like CMD. I usually do like water shows though sometimes an exception makes me think of other ways. :)

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...