Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

11
  • Please point out if you want the batch script to start your program, or the batch script should detect when the program is run. The latter is a lot more difficult. Commented Feb 28, 2015 at 16:20
  • You NEED to give an explanation of what you are trying to accomplish better. I suggest asking a new question with exactly what you want explained. You've already messed this one up beyond redemption.
    – krowe
    Commented Feb 28, 2015 at 16:48
  • please check my edited question. -Thank you-
    – hsawires
    Commented Feb 28, 2015 at 16:49
  • Also, the part where we need to wait for it to close is going to require that we find the name of the program (the Windows HWND name [or the window title] not the file name). Because of this a batch file is going to be a horrible way to do this. I'd use .NET or C myself. Tell us EXACTLY which program you are using (include the version). Also, tell us what it is listed as in Task Manager > Processes.
    – krowe
    Commented Feb 28, 2015 at 16:53
  • 1
    Renaming the directory before starting Word is easy as shown in the answers listed. Even renaming after Word starts is easy enough using something like start "rename" cmd.exe /c sleep.exe 500 ren "dir1" "dir2". But, I don't think you can rename the folders back before Word has exited without writing a Word plugin/extension. Or, without using something like AutoHotkey or AutoIt, where the Alt+F4 is intercepted by AHK which in turn renamed the directories back and then exits Word. (Starting Word from a shortcut using AHK would allow for much more accurate renaming of the directories as well..)
    – kodybrown
    Commented Feb 28, 2015 at 17:12