Jump to content

run comspec for documents & setings area


Recommended Posts

I am trying to run comspec dir for the Username\temp folder ..

cant seem to get into Documents and settings with run comspec dir

heres the short version.......... 1 works and the other will not???????

#include <GUIConstants.au3>

$hdata="\*.*"

RunWait(@ComSpec & " /c " & "dir " & @UserProfileDir & "\Local Settings\Temp" & $hdata & " /a :h /b /s" & " > " & @TempDir & "\dir.txt","",@SW_HIDE)

;RunWait(@ComSpec & " /c " & "dir " & @HomeDrive & "\Temp" & $hdata & " /a :h /b /s" & " > " & @TempDir & "\dir.txt","",@SW_HIDE)

SLEEP(1000)
Run('Notepad "' & @TempDir & '\dir.txt"')
Exit

i can view C:\$any_folder ..... except C:\Documents and Settings\$any_folder

help please ;-)

NEWHeader1.png

Link to comment
Share on other sites

Comspec does not like spaces in the address, so a mixture of single and double quotes, should help to fix this.

#include <GUIConstants.au3>

$hdata="\*.*"

RunWait(@ComSpec & ' /c ' & 'dir "' & @UserProfileDir & '\Local Settings\Temp' & $hdata & '" /a :h /b /s' & ' > "' & @TempDir & '\dir.txt"','',@SW_HIDE)

;RunWait(@ComSpec & ' /c ' & 'dir "' & @HomeDrive & '\Temp' & $hdata & '" /a :h /b /s' & ' > "' & @TempDir & '\dir.txt"','',@SW_HIDE)

SLEEP(1000)
Run('Notepad "' & @TempDir & '\dir.txt"')
Exit
Link to comment
Share on other sites

Comspec does not like spaces in the address, so a mixture of single and double quotes, should help to fix this.

#include <GUIConstants.au3>

$hdata="\*.*"

RunWait(@ComSpec & ' /c ' & 'dir "' & @UserProfileDir & '\Local Settings\Temp' & $hdata & '" /a :h /b /s' & ' > "' & @TempDir & '\dir.txt"','',@SW_HIDE)

;RunWait(@ComSpec & ' /c ' & 'dir "' & @HomeDrive & '\Temp' & $hdata & '" /a :h /b /s' & ' > "' & @TempDir & '\dir.txt"','',@SW_HIDE)

SLEEP(1000)
Run('Notepad "' & @TempDir & '\dir.txt"')
Exit

<{POST_SNAPBACK}>

I will try to study the differences........ thanks much MHz

NEWHeader1.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...