Jump to content

Recommended Posts

Posted

I've got a vbs script which reads argument and takes it as a variable i.e.

myscript.vbs /var:1

my script reads this as

StrMyvar = Wscript.Arguments.Named("var")

Is there any way of passing value to var from file in Linux it would look like this

myscript /var:`cat /path/to/file` what is the equivalent of this in DOS?


Posted

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.

Posted

Hi, thanks for response.

Let's say I've got a file called myfile with 1 line written in it:

c:\windows

Is there any way of calling dos cd comman and pass that line from the file so result would be

cd c:\windows

?

Thanks for your help

Posted
Hi, thanks for response.

Let's say I've got a file called myfile with 1 line written in it:

c:\windows

Is there any way of calling dos cd comman and pass that line from the file so result would be

cd c:\windows

?

Thanks for your help

For /F %%A in (myfile.txt) DO cd %%A

:unsure:

Though it would be easier to write the whole line:

cd c:\windows

to a file, give it the .bat or .cmd extension and START it.

jaclaz

Posted

Hey thanks for reply, I tried below:

C:\>type h:\file

c:\windows

C:\>For /F %%A in (h:\file) DO cd %%A

%%A was unexpected at this time.

:( no joy... Can you help please?

Posted

Yes, you use single percentage sign % in command prompt and double %% in batches, I assumed you would have scripted it.

jaclaz

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...