|
Answer» i have an BATCH file that i turned into an .EXE named 1.EXE on a removable USB Drive at F:\ and its code is: Code: [Select]START C:\SYSTEM\BATCH.EXE and C:\SYSTEM\BATCH.EXE is another batch files complied into an .EXE , its code is: Code: [Select]ping 127.0.0.1 -n 50 the F:\1.exe is a "Ghost-no window application" & the C:\SYSTEM\BATCH.EXE is a "console application". so when F:\1.exe is ran it doesn't show anything but when the C:\SYSTEM\BATCH.EXE is ran it shows a CMD window with the ping RESULTS in it.
when ran the F:\1.EXE starts the C:\SYSTEM\BATCH.EXE just fine, but the ping is being ran from F:\ instead of C:\SYSTEM\ why is this happening and how can i make it run from the place where C:\SYSTEM\BATCH.EXE is instead of F:\It's not running from the "wrong" place. It's running from a different place from what you expected it to.
If a batch file is located in a folder, unless you tell it different, it treats that folder as its home folder. If you have a batch file in folder F:\ and it calls another batch file in the folder c:\system, that second batch inherits the home folder of the file that called it.
You would NEED to change the drive and folder e.g. by including this line in the file in F:\ before calling the file in c:\system.
cd /d c:\system
THANX AGAIN CONTREX... you always seem to have a simple solution for my dumazz...
Quote from: gumbaz on August 11, 2007, 12:58:59 AM THANX AGAIN CONTREX... you always seem to have a simple solution for my dumazz...
Gumbaz, that's what i like about DOS & command prompt, there's usually a simple answer out there somewhere. Always glad to share...
|