Sign in to follow this  
Followers 0
anybastard

run command and variable question

3 posts in this topic

Hi guys ,

please, i need your help

On my script i need run this command

run (@SystemDir & "\fsutil.exe file createnew  c:\test4.txt 52428800")

this code works fine, i have on my path C:\ a file test4.txt

But unfortunatly the path ( c:\ ) is variable, it could be d:\ or f:\

Now i have my correct path in a variable for example $from .

Is possible include my variable on previous command ?

example

run (@SystemDir & "\fsutil.exe file createnew  '$from' test4.txt 52428800")

Thanks so much

Best Regards

AnyB

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Does this work?

And dont forget to use :\ in the variable..

But if you put a :\ at the end of the variable in the script you can only worry about using a letter as the variable.

run (@SystemDir & '\fsutil.exe file createnew  ' & $from & 'test4.txt 52428800')

EDIT: use this to only have a letter as the variable

run (@SystemDir & '\fsutil.exe file createnew  ' & $from & ':\test4.txt 52428800')
Edited by Akarillon

Challenge accepted!

Share this post


Link to post
Share on other sites

Hi ,

thanks so much for your quick answer .

does this work ? -> No it is only an example to explain my problem

Your first example works fine . I wasn;t good with single quote

Best Regards

AnyB.

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