Jump to content

Need some help, Yet Again

Recommended Posts

I want my script to open a command prompt, do a directory list, then make a text file, and copying the directory list to the text file.

Opening the command prompt and making the text file I got, but how would I get the directory list from the command prompt to the text file? Any ideas?

Also, if I can get a directory list without the use of a command line, I could do that instead, Im open to suggestions

Edited by Ices
Link to post
Share on other sites

May help...

$sDirectory = 'c:\';Put the directory name here
$sOutPutFile = 'd:\test.txt';Put the output file name here

If StringRight($sDirectory,1) <> '\' Then $sDirectory = $sDirectory & '\'
$iHandle = FileFindFirstFile($sDirectory & '*.*')

While $iHandle <> -1
   $sFileName = FileFindNextFile($iHandle)
   If @error Then
   $sList = $sList & @CRLF & $sDirectory & $sFileName 

$sList = StringTrimLeft($sList,2);Remove the heading @crlf

Edited by ezzetabi
Link to post
Share on other sites

use this to run a hidden cmd window and get dir

#include <Process.au3>

_RunDos("Dir" & " > " & @TempDir & "\temp.txt")

Change @TempDir & "\temp.txt", to the place you want to same the text file as, and also change "dir" by first opening the directory to get files/fodler of


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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...