how to get current directory for executing batch file from c

Put your programming skills to the test in these challenges.

how to get current directory for executing batch file from c

Post by Powermun50 on Mon Apr 01, 2013 12:36 pm
([msg=74845]see how to get current directory for executing batch file from c[/msg])

I have a batch file(lunch.bat) to run which has command to run another batch file(main.bat). I copyied this two files in my pendrive. I know my pendrive's drive latter in my computer,that's why i can configure 1st batch file(lunch.bat) to run another batch on my computer. But when i copy this two files in my pendrive and insert it to another computer, 1st batch file can't run another batch file. So this is a problem for me. Can anybody help me to get current directory command like c++(GetCurrentDirectory) function to run batch from any computer and from any drive?
Powermun50
New User
New User
 
Posts: 13
Joined: Wed Dec 19, 2012 2:31 am
Blog: View Blog (0)


Re: how to get current directory for executing batch file from c

Post by LoGiCaL__ on Mon Apr 01, 2013 6:03 pm
([msg=74849]see Re: how to get current directory for executing batch file from c[/msg])

Not 100% sure if this is what you're looking for but have you tried setting a varible to cd ?

Check out this link:

http://stackoverflow.com/questions/10456801/batch-file-equivalent-of-currentdir-pwd
User avatar
LoGiCaL__
Addict
Addict
 
Posts: 1062
Joined: Sun May 30, 2010 12:33 pm
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests