CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #16  
Old 12-18-2003, 04:48 AM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
If you want to pursue the "execute batch script during user logon process" approach, here are a few links:

http://www.winnetmag.com/WindowsScripting/Article/ArticleID/20502/20502.html
http://www.computerperformance.co.uk/Logon/logon_scripts.htm
http://support.microsoft.com/default...NoWebContent=1
http://www.experts-exchange.com/Operating_Systems/Win2000/Q_20781573.html

Hope this helps,

Claus
Reply With Quote
  #17  
Old 12-18-2003, 06:30 AM
MikeBoswell MikeBoswell is offline
CAD Sys Adm
 
Join Date: Feb 2003
Location: Andover, MA
Posts: 99
Claus,

That command does set the variable, but like you suspected, too late in the load.

what if I set up a routine in the corp sd_customize that checked if the SDUSERCUSTOMIZEDIR was set. If yes continue if no set it permanently and restart OSDM or gracefully crash ?

I think a 3rd party setenv would set it permanently, or setx in the res kit maybe.

This has become a challenge at this point.


Still having fun though.

Oh yeah Im triing to avoid the login batch approach.
Reply With Quote
  #18  
Old 12-18-2003, 06:37 AM
Markus Markus is offline
Registered User
 
Join Date: Oct 2002
Location: Sindelfingen, Germany
Posts: 88
Quote:
Originally posted by clausb
... It is not clear whether or not this is sufficient to redirect customization searches. OSDM might inquire the value of SDUSERCUSTOMIZEDIR from the operating system very early during the startup process, so changing the variable later on might not have any effect.
Yes, that's correct. It is not sufficient to assign a new value to this system variable. OSDM checks this variable very early in the startup process and stores its value in an internal variable.
I'm not sure why you want to change this variable, but you could try to assign a new value to ui::*corp-ui-cust-dir*. This might work, but I can't guarantee this.

Cheers,
Markus
Reply With Quote
  #19  
Old 12-18-2003, 07:23 AM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
If setting the environment variable in the customize files is too late, you can try to start OSDM with a -bootform script. Add the -bootform option in the command line for OSDM (you will have to modify the shortcut for this) and have it execute the putenv LISP code. The downside of this approach is that you will have to change the shortcuts on all systems where OSDM is installed, and that's probably not an option for you, either.

There doesn't seem to be silver bullet solution for this in your situation, or at least it hasn't occurred to me yet (ideas welcome). Most people trying to centralize their users' profile settings probably simply use roaming profiles which is a general OS mechanism meant to address exactly this problem. However, roaming profiles require a pretty homegenous setup on all systems using them. But then, I never tried to use roaming profiles before, so there might be interesting configuration options for Windows administrators to fine-tune them for your needs.

Claus
Reply With Quote
  #20  
Old 12-18-2003, 08:36 AM
Thom Ivancso's Avatar
Thom Ivancso Thom Ivancso is offline
Registered User
 
Join Date: Oct 2002
Location: Connecticut, USA
Posts: 212
Hello Mike,

You could use a VBScript placed in the users C:\Documents and Settings\username\Start Menu\Programs\Startup folder so that when the user logs in it would run automatically. I wrote one that works great it writes into the system or users environment a SDUSERCUSTOMIZEDIR variable set to C:\username\sd_user folder and I then wrote a user_customize file the just displayed a message box. I will include the VBScript called UserName.txt, just rename it to UserName.vbs and run it. The script has the code for placing the variable in either the system or user environment.

I hope this helps.

Cheers
Thom
Reply With Quote
  #21  
Old 12-18-2003, 08:37 AM
Thom Ivancso's Avatar
Thom Ivancso Thom Ivancso is offline
Registered User
 
Join Date: Oct 2002
Location: Connecticut, USA
Posts: 212
Forgot to post the file, here it is.



Cheers
Thom
Attached Files
File Type: txt username.txt (1.7 KB, 470 views)
Reply With Quote
  #22  
Old 12-18-2003, 09:38 AM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Quote:
Originally posted by clausb
I think this actually makes sense, in a way. System settings apparently cannot depend on user settings, such as %USERNAME% in this particular case. I assume that when Windows evaluates system environment settings, it simply does not take user settings into account.
That does make sense. Since the system variables are set first and user variables second, a system variable cannot expand the value of a user variable.

Another option would be to start Modeling with a batch file which sets the variable then calls the standard startup executables. You can then modify the shortcut which starts Modeling to run the batch file. A simple batch file would be something like:

Code:
set SDDIR=C:\Program Files\CoCreate\OSD_Modeling_12.0.0.8
set SDUSERCUSTOMIZEDIR=\\servername\common\OSDM\%USERNAME%

chdir /d %SDDIR%\binNT
"%SDDIR%\SD.exe" "%SDDIR%\binNT\SolidDesigner.exe" %1 %2 %3 %4 %5 %6 %7 %8 %9
__________________
John Scheffel
Reply With Quote
  #23  
Old 12-18-2003, 11:21 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
you can put a BATCH file into c:\document_and_settings\<user>\startmenu\program\autostart

this batch might contain something linke

set SDUSERCUSTOMIZEDIR=somewhere\%USERNAME%\....

hmmm.. will this work?

at least this is working for me to do a subst command. . but I fear that this ENV variable is again only valid for this (temporary) dos shell..

Just an idea..

may be the more modern versions of windows have somthing like an 'export' in their dosshell?
Reply With Quote
  #24  
Old 12-18-2003, 11:53 AM
MikeBoswell MikeBoswell is offline
CAD Sys Adm
 
Join Date: Feb 2003
Location: Andover, MA
Posts: 99
Wolfgang, John, and Thom,

Thanks for the latest suggestions.

I am going to do my best to avoid revisiting (physically or remotely) all of the seats to set this up. I like to exploit my the most convient approach which a little bit of exported/imported registry has allowed me to do w/ the SDCORPCUSTOMIZEDIR. That is all in place and it is great when I can just plug something new in and everyone gets it on the next session. Cant argue w/ that.

Sooooo........

Does anyone know the OSDM command that would allow me to kick off a batch file on startup of OSDM.

IF var is set, continue
else
I will use this command to run a bat that will perm set the var
Then command (exit) to shutdown and relaunch the OSDM session.

I think this is worth a try.

So anyone know the command that accesses win2000 commands from within OSDM?

THANKS A TON FOR ALL THE INTEREST AND TIME.

Mikeb
Reply With Quote
  #25  
Old 12-18-2003, 10:15 PM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
Once again, setting an environment variable from a batch file which you start from OSDM will NOT change OSDM's environment, i.e. your copy of SDUSERCUSTOMIZEDIR will NOT change.

For this reason, I don't think it will help you much to know that the official Integration Kit function to start external commands is (oli:sd-sys-exec "somecmd").

Claus
Reply With Quote
  #26  
Old 12-19-2003, 03:38 AM
MikeBoswell MikeBoswell is offline
CAD Sys Adm
 
Join Date: Feb 2003
Location: Andover, MA
Posts: 99
Thanks,

Actually, Thom's vb scipt should work.

Thom, do you know of a way to force windows to reread it's env so that the user does not need to logout/in??

I will set the var , if it is not already, and force the session to close. The var will be picked up as soon as the user launches the follow-up session.

Worst case the user will need to logout/in in order to pick up the new SDUSERCUSTOMIZEDIR.

(if (equal (oli:sd-sys-getenv "SDUSERCUSTOMIZEDIR ") nil) [(display "setting SDUSERCUSTOMIZEDIR, please relaunch session") (oli:sd-sys-exec "Thom's VB") (sleep 5) (exit)] (display "already set"))

2 things about the above:
1. How do you say 'if (not equal ( xxxxx' in LISP or is the 'nil' thing an OK approach for the var not being set.
2. I get errors running mult command in the 'then' statement. suggestions?



Thanks everyone .

Mike Boswell
Reply With Quote
  #27  
Old 12-19-2003, 05:19 AM
clausb's Avatar
clausb clausb is offline
Registered User
 
Join Date: Nov 2002
Posts: 1,168
To force a system-wide update of environment variables, you need to fire the WM_SETTINGCHANGE event (in broadcast mode). See http://msdn.microsoft.com/library/en-us/wceui40/html/cerefWM_SETTINGCHANGE.asp and http://msdn.microsoft.com/library/en-us/dllproc/base/environment_variables.asp for details.

For your LISP questions, check the Common LISP reference manual at http://www.lispworks.com/reference/HyperSpec/ or the LISP introduction at http://psg.com/%7Edlamkins/sl/contents.html. There is also a short introductory text on LISP in the Integration/Developer Kit documentation which is installed along with OSDM.

Claus
Reply With Quote
  #28  
Old 12-19-2003, 09:16 AM
Thom Ivancso's Avatar
Thom Ivancso Thom Ivancso is offline
Registered User
 
Join Date: Oct 2002
Location: Connecticut, USA
Posts: 212
VBScript

Hello Mike,

Glad the VBScript worked. If you have the VBScript set the user environment variable the user will not need to log out and in again to have it set. Normally user variables take as soon as they are set, unlike system variables that require a re-boot. You can also write a checking routine in the VBScript to check to see if the variable is set or not. Also as far as single point customizations and administrations go, you can place the VBScript on a shared access drive and copy a shortcut of it in to the users C:\Documents and Settings\username\Start Menu\Programs\Startup folder. This way if you want to make a global change you can and the shortcut will pick it up as soon as you save the changes.


Hope this helps
Happy Holidays
Thom
Reply With Quote
  #29  
Old 12-23-2003, 07:43 AM
MikeBoswell MikeBoswell is offline
CAD Sys Adm
 
Join Date: Feb 2003
Location: Andover, MA
Posts: 99
So here is what Ive got:

In the SDCORPCUSTOMIZE sd_customize:

(if (equal (oli:sd-sys-getenv "SDUSERCUSTOMIZEDIR") nil) (oli:sd-sys-background-job "\\\\server\\users\\me_common\\vicor_cust_nt\\corp_cust\\run_user_cust.bat"))
(if (equal (oli:sd-sys-getenv "SDUSERCUSTOMIZEDIR") nil) (exit))

In the SDCORPCUSTOMIZE directory:

run_user_cust.bat

--> bat consists of:

\\serveri\users\me_common\vicor_cust_nt\corp_cust\username.vbs
\\server\users\me_common\vicor_cust_nt\corp_cust\SD_shutdown.html


It works like this:

-user kicks off SD session.
-SDCORPCUSTOMIZEDIR sd_customize checks if SDUSERCUSTOMIZE var is set.
-if set (life goes on)
-if not set runs Thom's vb script setting var
-exits SD
-shows an html message explaining what happened.

The user must log off log in to windows to pick up the SDUSERCUSTDIR.
Also, any local custs must be copied to the SDUSERCUSTDIR.

This will allow users to travel w/ their custs. (ie conference rooms, other PC's)

Last edited by MikeBoswell; 12-23-2003 at 09:20 AM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:28 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.