Draygoes Posted April 1, 2014 Share Posted April 1, 2014 Hello all. I am trying to automate creating large test files. The code will pretty much tell you what I am trying to accomplish. $Number = "1" $SizeType = "MB" If $SizeType = "MB" Then $Size = "1048576" * $Number EndIf If $SizeType = "GB" Then $Size = "1073741824" * $Number EndIf Run(@ComSpec & " /c " & 'fsutil file create new c:\users\steve\desktop\1gb.test' & $Size & "'" , "", @SW_HIDE) All I need is for the variable "$Size" to be inserted at the end of the command. This is proving harder than I thought. Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
Solution Hawkysoft Posted April 1, 2014 Solution Share Posted April 1, 2014 (edited) not at home atm but u should try this...Run(@ComSpec & " /c fsutil file createnew test.txt " & $Size,"",@SW_HIDE) Edited April 1, 2014 by Hawkysoft Draygoes 1 Link to comment Share on other sites More sharing options...
Gianni Posted April 1, 2014 Share Posted April 1, 2014 I would try to change create new to createnew (no space) and will add a space right after "desktop1gb.test ' <- add a space here after test Draygoes 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Draygoes Posted April 1, 2014 Author Share Posted April 1, 2014 Thanks guys! The code above works, and thanks to PincoPanco for your explination. Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. 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