Sign in to follow this  
Followers 0
Valuater

run comspec for documents & setings area

4 posts in this topic

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

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 =( :">


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
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

Share this post


Link to post
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

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  
Followers 0