Jump to content

Recommended Posts

Posted

Hello everyone, is there a way to set a variable in a cmd file to get the current path it is located?

like i have test.cmd

start /wait vb6.js

echo complete

i guess it looks for vb6.js in system32 like and gives an eror (file not found)

it extracts in a the temp folder so i cant know the folder path evry time :}

what i am looking for is a variable maybe, that will get the current path somthing like this

test2.cmd

variable1 = $current_path$
start variable1\vb6.js

echo comlpete

Is this possible?

Thanks :hello:


Posted

Use this snippet

for /f "tokens=*" %%a in ('cd') do set currdir=%%a

then you can use %currdir% in the rest of your batch

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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