| View previous topic :: View next topic |
| Author |
Message |
tireless
Joined: 02 Oct 2007 Posts: 27
|
Posted: Wed May 20, 2009 1:25 pm Post subject: "Start directory" wrong |
|
|
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:\ |
|
| Back to top |
|
 |
Surveyor
Joined: 08 Feb 2008 Posts: 145 Location: British Columbia, Canada
|
Posted: Wed May 20, 2009 4:05 pm Post subject: Bug? |
|
|
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:
- keep Test.bat, as before, in C:\
- change execute setup:
Command= C:\test.bat
Working directory= %d
- 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! |
|
| Back to top |
|
 |
tireless
Joined: 02 Oct 2007 Posts: 27
|
Posted: Thu May 21, 2009 2:02 am Post subject: |
|
|
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
| Quote: | 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. |
|
| Back to top |
|
 |
Instructor Site Admin
Joined: 06 Jul 2006 Posts: 4646
|
Posted: Thu May 21, 2009 2:29 pm Post subject: |
|
|
tireless
Command: %f
Working directory: %d\ |
|
| Back to top |
|
 |
tireless
Joined: 02 Oct 2007 Posts: 27
|
Posted: Thu May 21, 2009 4:28 pm Post subject: |
|
|
| Instructor wrote: | tireless
Command: %f
Working directory: %d\ |
Thanks  |
|
| Back to top |
|
 |
tireless
Joined: 02 Oct 2007 Posts: 27
|
Posted: Wed Jun 10, 2009 9:52 am Post subject: |
|
|
| Instructor wrote: | tireless
Command: %f
Working directory: %d\ |
Can't execute D:\(Test).bat. Change Command to "%f", can fix it. |
|
| Back to top |
|
 |
|