Jump to content
Sign in to follow this  
Valuater

run comspec for documents & setings area

Recommended Posts

Valuater

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

Share this post


Link to post
Share on other sites
buzz44

could be the use of quotation marks for the variables, i know that it uses different ' and " for different things but dont know which sry =( :">


qq

Share this post


Link to post
Share on other sites
MHz

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

Share this post


Link to post
Share on other sites
Valuater

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

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  

×