D
D
dark_soho2016-06-22 14:36:02
PowerShell
dark_soho, 2016-06-22 14:36:02

Is it possible to rewrite from powershell to bat?

Hello.
There is a powershell script:

if not exist \\share\audit\%COMPUTERNAME%.txt ( \\share\audit\aida\aida64.exe /R \\share\audit\%COMPUTERNAME% /TEXT /CUSTOM \\share\audit\aida\aida64.rpf ) else exit

taken from here: https://habrahabr.ru/post/138400/
Briefly essence: Inventory in the domain. The script clings with policies to the login parameters of domain accounts, launches aida64 in the shared folder with the specified parameters, aida64 forms a text file on the working machine according to the given template and buries it to the specified path.
Question: is it possible to implement the same on bat? because in the domain there are machines below windows 7
If anyone can roll out a batch file, I will be very grateful.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kestik, 2016-06-22
@dark_soho

@echo off
if not exist "\\share\audit\%COMPUTERNAME%.txt" (
  "\\share\audit\aida\aida64.exe" /R "\\share\audit\%COMPUTERNAME%" /TEXT /CUSTOM "\\share\audit\aida\aida64.rpf"
)
else (
  exit
)

And in one line:
if not exist "\\share\audit\%COMPUTERNAME%.txt" ( "\\share\audit\aida\aida64.exe" /R "\\share\audit\%COMPUTERNAME%" /TEXT /CUSTOM "\\share\audit\aida\aida64.rpf" ) else ( exit )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question