AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Directory > File listing - "dir /b /s *.mp3 > fil

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
twikkistep



Joined: 03 Oct 2006
Posts: 4

PostPosted: Tue Oct 03, 2006 5:44 am    Post subject: Directory > File listing - "dir /b /s *.mp3 > fil Reply with quote

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
View user's profile Send private message
BoBo
Guest





PostPosted: Tue Oct 03, 2006 9:26 am    Post subject: Reply with quote

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

PostPosted: Tue Oct 03, 2006 9:39 am    Post subject: Reply with quote

Thanks!!
Back to top
View user's profile Send private message
scriptmonkey



Joined: 19 May 2006
Posts: 112

PostPosted: Fri Nov 16, 2007 8:10 am    Post subject: Reply with quote

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
View user's profile Send private message
garry



Joined: 19 Apr 2005
Posts: 1157
Location: switzerland

PostPosted: Fri Nov 16, 2007 8:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group