 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
twikkistep
Joined: 03 Oct 2006 Posts: 4
|
Posted: Tue Oct 03, 2006 5:44 am Post subject: Directory > File listing - "dir /b /s *.mp3 > fil |
|
|
Hi,
Is there a way I can run a dos command from AHK? I looked through the documentation and this forum, but couldn't get a correct answer.
I'm trying to do the same as in dos and reading in the contents of the listing to the clipboard ...
"dir /b /s *.mp3 > file.txt" (without the file.txt intermediate step actually)
Thanks for any help.
-- TS |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Tue Oct 03, 2006 9:26 am Post subject: |
|
|
You gave yourself the correct answer:
| Quote: | | Is there a way I can run a dos command from AHK? |
|
|
| Back to top |
|
 |
twikkistep
Joined: 03 Oct 2006 Posts: 4
|
Posted: Tue Oct 03, 2006 9:39 am Post subject: |
|
|
| Thanks!! |
|
| Back to top |
|
 |
scriptmonkey
Joined: 19 May 2006 Posts: 112
|
Posted: Fri Nov 16, 2007 8:10 am Post subject: |
|
|
I am trying to do something similar to what the dir command does in Windows command line, but with Autohotkey.
I need to go thru a dir and any sub dirs and export the path,filename, and modification date of any .jpg files.
I created a thread asking this question, but what would be the windows command line string to use to do this? This may help me with my Autohotkey script.
Thanks. _________________ Zak M. |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1157 Location: switzerland
|
Posted: Fri Nov 16, 2007 8:44 am Post subject: |
|
|
hello scriptmonkey
see also here:
http://www.autohotkey.com/forum/viewtopic.php?t=25655
look in the help for different A_loopfile.....
| Code: |
AA=c:\test
F1=savedfilenames.txt
ifexist,%F1%
filedelete,%F1%
fileappend,Content from %AA% at %A_now%`r`n,%F1%
fileappend,PATH--;NAME--;MODIFICATIONDATE`r`n,%F1%
fileappend,------------------------------------------------------`r`n,%F1%
I=0
Loop %AA%\*.jpg,,1
{
LFP=%A_LoopFileLongPath%
LFN=%A_LoopFilename%
LFM=%A_loopfiletimemodified%
fileappend,%LFP%;%LFN%;%LFM%`r`n,%F1%
I++
}
fileappend,------------------------------------------------------`r`n,%F1%
fileappend,Total=%I% jpg files found`r`n,%F1%
run,%F1%
exitapp
|
twikkistep, DOS command :
| Code: | F1="%A_scriptdir%\file.txt"
mypath=c:\test
setworkingdir,%mypath%
run,%comspec% /c dir /b /s *.mp3 >%F1%,,hide ;hidden
;run,%comspec% /k dir /b /s *.mp3 >%F1% ;not hidden
run,%F1%
exitapp
|
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|