|
Post by ezmoney on Feb 12, 2013 2:17:32 GMT -5
I was trying to use the shell$ command to get some data and perform some operations.
But it starts in the RB directory and I want this to work on "my documents" files.
I tried a Change directory CD command but it did not change anything.
print shell$("dir") gives the RB directory.
print shell$("cd mydirectorypath")
print shell$("dir") gives the RB directory again.. What I really want is to sort my file..
print shell$(sort/+1 filein.txt >fileout.txt) but I must be in the right directory for this to happen.
Another thing is after I issue the command then the program will go on regardless of the time required for the instruction to finish.... other than testing for the created out put file is there a way to get the program to wait or sleep till this operation complets?
|
|
|
Post by StefanPendl on Feb 12, 2013 16:39:25 GMT -5
Use full paths, then there is no need for changing the directory.
BTW, would you mind starting new threads for new questions. Littering other threads with inappropriate posts is not tolerated.
|
|
|
Post by ezmoney on Feb 13, 2013 1:48:42 GMT -5
Where would I find the new threads button?
|
|
|
Post by ezmoney on Feb 13, 2013 2:25:08 GMT -5
thanks I found the new threads button...
I tried what you said but when I get into really long path the system says it can't find it... I can find a simple "C:\*" but I cut and pasted the path address so I wouldn't make a typing erorr and it says it can't find the link..
print shell$(dir c:\*") works with good return..
but when I try the long path version i get can't find the file..
path$="c:\Documents and Settings\ezmoney\my documents\myfile*"
print shell$("dir "+path$)
that comes back as....
"The system cannot find the path specified."
I know the files are out there as I did the same dir from a command and recieved return..
|
|
|
Post by ezmoney on Feb 13, 2013 2:55:50 GMT -5
PS... I wantet to use the CD to get away from those long typing and higher chance of error putting that code in... Thus the reason to change the directory was it made the process much easier and very straight forward. Coding can be complexed I like to keep it simple.
I am not saying you can not do it just that simple stuff works for me.... Why make life complicated?
|
|
|
Post by StefanPendl on Feb 13, 2013 17:20:14 GMT -5
You can only execute one command in the shell and there will be nothing remembered.
If you happen to execute more commands, you need to create a batch file and execute that.
A batch file can be created by your program, so there must not be a static one.
|
|
|
Post by ezmoney on Feb 18, 2013 3:46:32 GMT -5
I have created files.bat and then the darned batch file won't execute.
For some reason.
But when I do a copy to a new xxx.bat file then execute the xxx bat file it works...
Any idea what is happening here?
I know the files has been closed and the program has hit the end statement of the program.... That should make the file accessable and fully operational....
Any comments? Suggestions? Other?
|
|
|
Post by ezmoney on Feb 18, 2013 3:49:54 GMT -5
Some of the data requies a sort after processing there for the sort is static and generally don't change thus the need just to call that stactic batch file so I don't have to do that manually... Automation displaces labor and the laborious task of remembering all those sorts and sort fields and so on.
|
|