On Mon, Mar 25, 2013 at 10:10 PM, Howard W. Smith, Jr. < smithh032...@gmail.com> wrote:
> On Mon, Mar 25, 2013 at 6:57 PM, Patrick Flaherty <pflah...@rampageinc.com > > wrote: > >> >> On Mar 25, 2013, at 1:15 PM, Howard W. Smith, Jr. wrote: >> >> On Mon, Mar 25, 2013 at 11:14 AM, Patrick Flaherty >>> <pflah...@rampageinc.com>**wrote: >>> >>> Update: If I'm login interactively (meaning machine boots and I login >>>> and >>>> get my desktop) and that interactive account matches the service login >>>> account >>>> then "net use" from within the service does return all mapped drives. >>>> >>>> >>>> I expected as much. It seems as though you cannot get away from the >>> requirement of having to login 'first'...to get everything working as >>> designed/expected in your app. >>> >>> Excuse me, if I missed the business requirement specification (earlier in >>> this conversation), but is the requirement only to get a list of mapped >>> drives for 'your' user login or any enduser that logs into the production >>> server/client/PC/machine? >>> >>> can you add the list of network drives to a database table, and maintain >>> the database table and retrieve the list from that database table via the >>> tomcat-app-running-as-service? >>> >>> if you only need a list of mapped network drives for your user login, can >>> you just maintain a 'file' that has this list on the target/production >>> server, and whenever it changes, can you update the file, and make the >>> topcat-app-running-as-service to always read the file instead of having >>> to >>> call 'net use'? >>> >>> IMHO and FWIW, i would never go with the approach of relying on a windows >>> 'command line' to do this/that for me. yes, in my app, i allow endusers >>> to >>> update files/documents, and the app saves the files/documents to a >>> certain >>> folder on the server, and my app will list those files on a web page, and >>> they can view/download those files from/via the web app... all that is >>> done >>> via java instead of doing a 'cmd.exe dir'. i'm new to java, always wanted >>> to be java developer, and loving what i can do with java. i'm almost >>> getting to the point, where my days of a 'windows user' are done... one >>> day, i hope to migrate to linux for target server instead of windows >>> server. :) >>> >> >> This is what I see. If my service logs in as "service-user" and I login >> normally to my desktop as "dt-user". >> I call "net use" from my service and get an empty list. Now I logout as >> "dt-user"and login as "service-user" and I mapped >> 4 drives and only 2 of the drives are mapped persisted (i.e. reconnect at >> logon). I logout as "service-user" and >> now I have my app call "net use" programatically and it returns the 2 >> drives that were mapped with persistence. >> Conclusion: Whatever drives are mapped persisted when logged in as the >> user the service logs in as, then your >> app can call "net use" and get those drives returned from "net use" even >> if your logged in as "dt-user" OR nobody >> is logged in at all !!!! >> >> Maybe someone can confirm my finding, but this is what I see. >> >> > Your findings are all good; reading and digesting and wanting to > respond/participate since I'm definitely a developer using/deploying-app to > Windows/tomcat7 . :) > > If you could provide a WAR (little test app), I would be more than willing > to give this a shot on my Windows Server 2008 64-bit (standard/Vista) > development server and maybe even try it on my Windows Server 2008 R2 > 64-bit (R2 = Windows 7, from what I understand), but I'd have to setup a > Windows user/environment for this...to mimic what you're doing. > > Now, onto the other responses. :) > > Sorry, I was going to say, I still would develop some type of batch file or some type of app that could run when user logs out of the machine...that will do a 'net use > \someDriveLetter\someFolder\someFile.txt', and I would make sure the app reads that file instead of going through the procedure of logging in as a certain user, logging out, and then running your tomcat-app-as-service...just so the app can reliably call 'net use' and get the expected/desired output. maybe i should have written this response against the last email that you sent. :) > >> Thanks again >> Pat >> >> >> >> >> >> >> ------------------------------**------------------------------**--------- >> To unsubscribe, e-mail: >> users-unsubscribe@tomcat.**apache.org<users-unsubscr...@tomcat.apache.org> >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >> >