Chester^ Posted March 23, 2005 Share Posted March 23, 2005 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.cmdstart /wait vb6.jsecho completei 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 thistest2.cmdvariable1 = $current_path$start variable1\vb6.jsecho comlpeteIs this possible? Thanks Link to comment Share on other sites More sharing options...
Yzöwl Posted March 23, 2005 Share Posted March 23, 2005 Use this snippetfor /f "tokens=*" %%a in ('cd') do set currdir=%%athen you can use %currdir% in the rest of your batch Link to comment Share on other sites More sharing options...
Chester^ Posted March 23, 2005 Author Share Posted March 23, 2005 Use this snippetfor /f "tokens=*" %%a in ('cd') do set currdir=%%athen you can use %currdir% in the rest of your batch<{POST_SNAPBACK}>Thanks alot it works perfect Link to comment Share on other sites More sharing options...
gunsmokingman Posted March 24, 2005 Share Posted March 24, 2005 Here Is A Another Wayecho off && cls && color 1f && Mode 62,3 && Set Here=%CD%TITLE %Here% && Echo Press Key To Closeset /p = Location=%Here% Link to comment Share on other sites More sharing options...
Chester^ Posted March 24, 2005 Author Share Posted March 24, 2005 Thanks . any idea on how to do this in a .js file? 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