Sign in to follow this  
Followers 0
voorock

dos command

8 posts in this topic

i want to do this dos command in autoit :

find "DisplayName" c:\test.reg | sort >c:\results.txt

find /v /i "Windows XP Hotfix" c:\results.txt | sort /o c:\%USERNAME%.txt

May u help me ?

Share this post


Link to post
Share on other sites



i want to do this dos command in autoit :

find "DisplayName" c:\test.reg | sort >c:\results.txt

find /v /i "Windows XP Hotfix" c:\results.txt | sort /o c:\%USERNAME%.txt

May u help me ?

there are also autoit ways to sort and find but

here a little help

try looking for _rundos in the helpfile it can run commands at the prompt

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

i want to do this dos command in autoit :

find "DisplayName" c:\test.reg | sort >c:\results.txt

find /v /i "Windows XP Hotfix" c:\results.txt | sort /o c:\%USERNAME%.txt

May u help me ?

I think I know what you're doing but i'm not sure. I have a few questions on this.

First of all, let me ask you why you're doing a find on an exported Reg file as opposed to the registry itself?

Second, what key are you polling or can you display the contents of the reg file so I can acertain what you're trying to get to?

Third, a little explanation of the use of sort as opposed to echo.

Let me know.

-Blademonkey

Edited by blademonkey

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Share this post


Link to post
Share on other sites

I think I know what you're doing but i'm not sure. I have a few questions on this.

First of all, let me ask you why you're doing a find on an exported Reg file as opposed to the registry itself?

Second, what key are you polling or can you display the contents of the reg file so I can acertain what you're trying to get to?

Third, a little explanation of the use of sort as opposed to echo.

Let me know.

-Blademonkey

Nice avatar :P

Indeed he has weird ways to read files much easier to use fileread and other string functions

or even just use the registry functions.

But he only gave enough info to only get dos prompt support

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I'm trying to do a program to make software inventory.

first i export the regkey : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall in a .reg file

then i want to find all the softwares.

I make this in .bat, it works, but now i want it in autoit ...

(sorry for my english)

@ echo off

cls

echo. Inventaire de votre poste en cours ....

echo %username% %COMPUTERNAME%>> c:\inventaire.txt

echo ======================================================================>> c:\inventaire.txt

Reg EXPORT HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall c:\uninstall.reg

find "DisplayName" c:\uninstall.reg | sort >c:\results.txt

find /v /i "Windows XP Hotfix" c:\results.txt | sort /o c:\%USERNAME%.txt

find /v /i "Bibliorom pour XP" c:\%USERNAME%.txt | sort /o c:\%USERNAME%1.txt

find /v /i "F-Secure" c:\%USERNAME%1.txt | sort /o c:\%USERNAME%2.txt

find /v /i "Intel® Extreme Graphics Driver" c:\%USERNAME%2.txt | sort /o c:\%USERNAME%3.txt

find /v /i "Internet Explorer" c:\%USERNAME%3.txt | sort /o c:\%USERNAME%4.txt

.....

find "DisplayName" c:\%USERNAME%4.txt | sort >>c:\inventaire.txt

del c:\%username%*.txt

del c:\results.txt

del c:\uninstall.reg

exit

Edited by voorock

Share this post


Link to post
Share on other sites

I'm trying to do a program to make software inventory.

first i export the regkey : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall in a .reg file

then i want to find all the softwares.

I make this in .bat, it works, but now i want it in autoit ...

(sorry for my english)

@ echo off

cls

echo. Inventaire de votre poste en cours ....

echo %username% %COMPUTERNAME%>> c:\inventaire.txt

echo ======================================================================>> c:\inventaire.txt

Reg EXPORT HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall c:\uninstall.reg

find "DisplayName" c:\uninstall.reg | sort >c:\results.txt

find /v /i "Windows XP Hotfix" c:\results.txt | sort /o c:\%USERNAME%.txt

find /v /i "Bibliorom pour XP" c:\%USERNAME%.txt | sort /o c:\%USERNAME%1.txt

find /v /i "F-Secure" c:\%USERNAME%1.txt | sort /o c:\%USERNAME%2.txt

find /v /i "Intel® Extreme Graphics Driver" c:\%USERNAME%2.txt | sort /o c:\%USERNAME%3.txt

find /v /i "Internet Explorer" c:\%USERNAME%3.txt | sort /o c:\%USERNAME%4.txt

.....

find "DisplayName" c:\%USERNAME%4.txt | sort >>c:\inventaire.txt

del c:\%username%*.txt

del c:\results.txt

del c:\uninstall.reg

exit

Try the manual for registry functions:

regread

regenumkey (to look for keys if you donot know name)

regenumval

you can read instandly from the registry without using needing to export and using find in dos prompt

Share this post


Link to post
Share on other sites

voorock take a look to this post. The function that I create will give you an array with a list of all software installed on the local computer or a remote computer. The only part that you will need to take care is the find, which you can do it reading the help file and using a combination of For loop and StringInStr.


AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

voorock take a look to this post. The function that I create will give you an array with a list of all software installed on the local computer or a remote computer. The only part that you will need to take care is the find, which you can do it reading the help file and using a combination of For loop and StringInStr.

or better for loops and regexp or just regexp;) stringregexp

http://www.regular-expressions.info/

Share this post


Link to post
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
Sign in to follow this  
Followers 0