bobheart Posted June 21, 2004 Share Posted June 21, 2004 The top line I hav commented out works with the drive letter in it . but i want to be able to put the drice letter in and it won't work ? what do I have wrong ? ;;RunWait(@COMSPEC & " /c Dir C:\ > dir.txt") $answer = InputBox("Question", "Enter drive letter below ", "what dir", "", -1,-1, 30, 30) $str = @Comspec & " /k Dir """ & @ScriptDir &" " & $answer & " > dir.txt" Run($str) Runwait("notepad.exe "&@Scriptdir&"\dir.txt",@WindowsDir,) if you have the time . Link to comment Share on other sites More sharing options...
cowsmanaut Posted June 21, 2004 Share Posted June 21, 2004 $drive = inputbox ("Drive letter", "Enter drive letter with quotes", "", "") runwait (@comspec & " /k dir " & $drive & " > dir.txt" ) this seems to work.. Link to comment Share on other sites More sharing options...
bobheart Posted June 21, 2004 Author Share Posted June 21, 2004 Well thank you for the help .. I see what you did but all have to look more and try to understand it . Link to comment Share on other sites More sharing options...
cowsmanaut Posted June 21, 2004 Share Posted June 21, 2004 it's more or less the same as what you did. However, I cut out a lot of the extra stuff. To keep it a little more simplified. with the input box I just used the defaults by not providing extra variables for the actual command.. rather than attaching it to a variable I just went straight ahead and performed it. It's often better to find the most straight forward method of executing your tasks. the less lines you need to look at the less work you need to do to update or fix your scripts in the end. moo Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now