ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: Removing zero length files recursively at command-line

<< < (2/4) > >>

questorfla:
set /p input=Entername  :
md %input%
cd %input%
set var=%cd%
7z e c:\preload.zip
echo %var% > path.txt
exit


OK that has got to be close now.  I was thinking too hard on the first step.  don't need to know the path at that point.
And even later with %var%   I don't need the exact path  yet   but I will need part of it eventually to create the "http://www" path so it can be accessed from a browser.
this is going to be a custom site installer utility when completed.  has a few more steps before done :)

4wd:
It could be that because I located the batchfile (I just called it auto.bat) in c:\ so I would be in the default path no matter where I was when I pressed AltF5 that maybe I am stuck.  I was hoping it would use the location of my "cursor" a a reference point and create the subdirectory there.-questorfla (July 31, 2014, 11:15 PM)
--- End quote ---

Correct, the "home" directory becomes the location of the command file because of the way you are calling it.

AFAIK, there's no way to get the current directory from a new invocation of CMD when going via a third party program unless the current directory is passed as a parameter.  Which doesn't seem to be possible as Clavier+ doesn't provide for determining where it's been invoked from.

An alternative would be a small external program that provides the path of the current active CLI window when it's called.

BTW, are you calling this from an active CLI window or from Explorer, (or something else)?

Just mucking around:

--- Code: Text ---rem qf666.cmd [file]remrem Where [file] = optional text file with one dir to create per line@echo offrem  If file passed as arg, use it if it exists, fall back to askingrem  if it does not.if "%~1"=="" goto :Requestif not exist "%~1" (  echo File does not exist  echo.  goto :Request)for /f "usebackq tokens=*" %%a in (`type "%~1"`) do (call :Extract "%%a")goto :END :Requestset /p newdir=Entername  :if "%newdir%"=="" goto :ENDcall :Extract "%newdir%"goto :END :Extractset ndir="%~1"md %ndir%pushd %ndir%7za.exe e C:\preload.zipcd > path.txtpopdgoto :EOF :END

questorfla:
not sure if mine came ahead of yours or which.  you are probably right in the end.  I have not yet added back the 'call from' AltF5  The script as written was located in the folder I have been testing with.

Just wondering, I have started playing around with AHK and thought maybe I could write the whole thong using AHK to get it started.  Maybe that would get around the need a batch file to be "located" somewhere specific.  Or, use the first step to copy the batch script to the folder in which I need to run it?  This will be complex enough in th end that I hope I can convert the whole thing to an executable.  Each step is always required.  One of my previous projects was something that I could run to create a working list of clickable hyperlinks to send the "BOSS" that I had to run every month to add any new "mini-sites".  Doing it like this, I could add the link to the list as the site was created.

And rather than fight the inevitable, I am also going to find a way to convert the few data-tables it needs from using MyISAM to using INNODB so I can upgrade the version of MySQL I have to use now.  5.5 is as high as I can go and still get support for MyISAM. 

However:  As a side-note, I recently ran across some references to a project called ARIA that is supposed to be a similar setup which does still support MyISAM.  For all the reports of why InnoDB is better, I never had any problems with MyISAM and without learning all the ins and outs of which calls I would need to modify as well as why I would need to do it, it might be easier to simply use ARIA.  I just found this reference last night by accident and have not looked into it at all    Using a different support engine could bring on other problems I don't want to deal with.  IF it turns out to be a simple "change the name' of the program used to create the tables, then I can manage that (I hope).

The scripting for the DB creation and handling is all done in a ".php" file.  This is not my 'forte'" (Nor even my "six-te'" )    8)  But it might bear looking into.

These are all sub-sites of a "Mothership"  Maybe "mother-site" is more appropriate.   Not all awake yet  :-\  )

As long as the databases hang together once created, if "PhpMyAdmin" can deal with ARIA then I might be able to keep what I have

4wd:
Instead of using a hotkey, why not just call it p.cmd and stick it in the path?

When run from CLI, still takes two keypresses, p then ENTER - probably takes the same amount of time to trigger also.

questorfla:
I hate it when nothing works right :( >:(
it MIGHT work if I created some proper links.  Or exited at a cmd prompt at he location where I want the new directory created.
the only way I can get the cmd to run is to type it in at start>run. I think it would run whether cmd or bat anyway.   Not used to having to do things this way.  it still created the directory at c:\
 (or wherever the xxx.cmd or xxx.bat is located).  I need to shift the focus of the run/create command to the location that I am currently opened to which is where I need that new directory to be created and loaded.  The 7z  parameter I had to change to "x" instead of "e" of course.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version