"Start directory" wrong

English main discussion
Post Reply
  • Author
  • Message
Offline
Posts: 27
Joined: Tue Oct 02, 2007 2:27 am

"Start directory" wrong

Post by tireless »

I set the "Execute" to:

Command="%f", Working directory=%d

Then I opened C:\Test.bat, the code is @cd&pause, and press Ctrl+F5, but the result is C:\WINDOWS\System32, not C:\

Offline
Posts: 147
Joined: Fri Feb 08, 2008 6:41 pm
Location: British Columbia, Canada

Bug?

Post by Surveyor »

tireless,

Your example is almost correct, but you are using Execute a little wrong. %F is a parameter to a command, not a command by itself. Try this:
  1. keep Test.bat, as before, in C:\
  2. change execute setup:
    Command= C:\test.bat
    Working directory= %d
  3. now open another file (anywhere) for editing and do Ctrl+F5. Execute should run the batch file (which displays the folder), but use the folder where the current file came from as its working directory.
Cheers!

Offline
Posts: 27
Joined: Tue Oct 02, 2007 2:27 am

Post by tireless »

I want execute current opened file, not a specify file, so I must use "%f". This problem is similar to:

If you double-click C:\WINDOWS\System32\cmd.exe, then
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\WINDOWS\system32>d:

D:\>c:

C:\WINDOWS\system32>
This is not a big problem, I can put .bat file not in the drive root, that's ok.

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

tireless
Command: %f
Working directory: %d\

Offline
Posts: 27
Joined: Tue Oct 02, 2007 2:27 am

Post by tireless »

Instructor wrote:tireless
Command: %f
Working directory: %d\
Thanks :)

Offline
Posts: 27
Joined: Tue Oct 02, 2007 2:27 am

Post by tireless »

Instructor wrote:tireless
Command: %f
Working directory: %d\
Can't execute D:\(Test).bat. Change Command to "%f", can fix it.
Post Reply