wally Posted January 8, 2009 Share Posted January 8, 2009 I've got a vbs script which reads argument and takes it as a variable i.e.myscript.vbs /var:1my script reads this asStrMyvar = Wscript.Arguments.Named("var")Is there any way of passing value to var from file in Linux it would look like thismyscript /var:`cat /path/to/file` what is the equivalent of this in DOS? Link to comment Share on other sites More sharing options...
Yzöwl Posted January 8, 2009 Share Posted January 8, 2009 To prevent non-functional or completely incorrect attempts at helping you with this problem, could you please try to explain a little better what it is you are trying to do and achieve. Link to comment Share on other sites More sharing options...
wally Posted January 15, 2009 Author Share Posted January 15, 2009 Hi, thanks for response.Let's say I've got a file called myfile with 1 line written in it:c:\windowsIs there any way of calling dos cd comman and pass that line from the file so result would becd c:\windows?Thanks for your help Link to comment Share on other sites More sharing options...
jaclaz Posted January 15, 2009 Share Posted January 15, 2009 Hi, thanks for response.Let's say I've got a file called myfile with 1 line written in it:c:\windowsIs there any way of calling dos cd comman and pass that line from the file so result would becd c:\windows?Thanks for your helpFor /F %%A in (myfile.txt) DO cd %%AThough it would be easier to write the whole line:cd c:\windowsto a file, give it the .bat or .cmd extension and START it.jaclaz Link to comment Share on other sites More sharing options...
wally Posted January 15, 2009 Author Share Posted January 15, 2009 Hey thanks for reply, I tried below:C:\>type h:\filec:\windowsC:\>For /F %%A in (h:\file) DO cd %%A%%A was unexpected at this time. no joy... Can you help please? Link to comment Share on other sites More sharing options...
wally Posted January 15, 2009 Author Share Posted January 15, 2009 FOR /F %i in (file) do cd %i worked!cheers Link to comment Share on other sites More sharing options...
jaclaz Posted January 15, 2009 Share Posted January 15, 2009 Yes, you use single percentage sign % in command prompt and double %% in batches, I assumed you would have scripted it. jaclaz 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