Jump to content
Macro Express Forums

Different result when launching batch file with ME vs double clicking it


Meanderthal

Recommended Posts

I'm using macro express to delete some Dropbox cache folders because it keeps filling up my hard drive with it's silly backups. I have a batch file which list's the folders and outputs them to a text file for ME:

@echo off

dir /ad /b > folders.txt

 

When I double-click on this batch file, it gives me a nice clean list of the subfolders.

2010-05-30

2010-05-31

2010-06-01

2010-06-02

2010-06-03

2010-06-04

2010-06-05

 

However when I launch this file from ME, the batch file runs fine, but the folders.txt file ends up on my Y drive, or whatever folder was last used, but never the folder that the batch file is in.

 

I vaguely remember having this or a related problem in launching things from visual basic, and the resolution then was to use cmd.exe to launch it with the batch file as a parameter. Again it's been awhile and I'm not sure whether it's related... something about comspec... c:\windows\system32\cmd.exe /C "D:\afolder\yourbat.bat". I've tried everything I can think of doing with the launch program command and nothing working. Here is the macro:

 

<DIS:<LOGERR:Y><IFOTH:10:1:G:\Documents and Settings\Eric\Application Data\Dropbox\cache><MSTOP><ENDIF><IFOTH:09:2:G:\Documents and Settings\Eric\Application Data\Dropbox\cache\dirlist.bat><MSTOP><ENDIF><DIS:<DOFILE:05:NN:G:\Documents and Settings\All Users\Shared Documents\System\dirlist.bat>G:\Documents and Settings\Eric\Application Data\Dropbox\cache\dirlist.bat><LAUNCHDEL2:0:01C:\WINDOWS\system32\cmd.exe "G:\Docume~1\Eric\Applic~1\Dropbox\cache\dirlist.bat"><TDELAY:4><IFOTH:09:2:G:\Documents and Settings\Eric\Application Data\Dropbox\cache\folders.txt><MSTOP><ENDIF><BTFBEG:001:000001:000000:G:\Documents and Settings\Eric\Application Data\Dropbox\cache\folders.txt><IFVAR2:1:01:2:><NMVAR:01:01:1:0000001:2:0000001><IFVAR2:2:01:4:3><LOGFILE:NN:G:\Documents and Settings\Eric\Application Data\Dropbox\cache\delme.batDEL %T1%><ENDIF><ENDIF><BTFEND><IFOTH:01:2:G:\Documents and Settings\Eric\Application Data\Dropbox\cache\delme.bat><LAUNCHDEL2:0:01G:\Documents and Settings\Eric\Application Data\Dropbox\cache\delme.bat><ENDIF>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...