cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Anyone know how to do this - run a remote process and insure it is in the Windchill shell for a PC

BobLehman2
12-Amethyst

Anyone know how to do this - run a remote process and insure it is in the Windchill shell for a PC

I want to run psexec (part of Microsoft pstool set) to connect to a series of remote machines and kick off commands that are dependent on being in the Windchill shell. For example windchill start or windchill stop. I do not want to have any sort of daemon or scheduled job running - I want to essentially login the psexec and either be in the Windchill shell or start a windchill shell and tell it to do something. One way I can think to do this is to not bother and just make sure my environment matches the shell, but that seems like it will eventually break - I will get out of synch.

I would have thought this would be any easy problem to solve, but I am stumped a bit. Any ideas or suggestions are greatly appreciated.

I tried running a windchill shell and trying to redirect a command into it

windchill shell < dothis.txt

where do this is
windchill start

but that does not work.

Thanks
--Bob

8 REPLIES 8

Hi Bob, if the tasks are known tasks you can create batch scripts for each one (containing shell command line, which can be found by RMB on OOTB WC Shell Shortcut) and then use PSEXEC to execute these commands natively on the server. My guess is that you are wanting to just plain and simple have a remote Windchill Shell, which I don’t know how to do though.


[cid:image001.gif@01CE1A6D.0856B260]

Steve Vinyard
Senior Solution Architect

Bob,
If Windchill is running as service on Windows, then you don't need to
use windchill shell. I used *sc* (Service Control)* *command along with *psexec
*in the past to start,stop, restart Windchill and other services on remote
servers.

psexec <server-name> 'sc start *PTCWindchill*'
psexec <server-name> 'sc stop *PTCWindchill*'

PTCWindchill is Windows service name


Regards,
Prathap <">http://goo.gl/LuT5>



Prathap,
Yes, that is correct - those were just an example - say I want run an ant script to rebuild the resource bundles on 5-10 method servers or some other command where I pretty sure I need all the windchill shell setup.

--Bob

Learn ANT, you’ll waste less time, and once you do, you can find that there is much help already in the codebase to help you with stuff…



Hi David,
Thanks for response.
I know ANT and use ANT, how does it help with this particular problem - you still have to figure a way to set your environment or work within the context of the shell and I want to be able to fire the request remotely in a PC environment. Am I missing something fundamental here or am I describing the problem poorly?

--Bob

Bob,


On Windows the Windchill shell environment must be recreated by your batch file. You can't use "Windchill Shell" because it breaks the 'link' to your batch file and won't let you run any subsequent commands. Iposted a solution to this last spring: http://portal.ptcuser.org/p/fo/st/topic=16&post=106961#p106961


Using this technique you can batch script Windchill commands and call your batch file via psexec.


Kind Regards,


Matt Meadows


Solutions Architect
VIRSO Inc
O: 618 937 8115
C: 314 749 8377
E: mmeadows@virsoinc.com

ehowanice
12-Amethyst
(To:mmeadows)

Really glad I found this thread and Matt's solution.  Currently having some Windchill issues, as a temporary work around need to use a windchill shell in a batch file, couldn't figure out how to do this until I came across this post. Very disappointing in when I asked PTC tech support they would not offer any assistance, especially when it was related to an open case.

jessh
12-Amethyst
(To:mmeadows)

Note that in addition to 'windchill.exe' 10.2 (at least M030, I forget about older MORs) and higher, contain a 'windchill2.bat' script that's purely a Windows batch script.  I believe it contains additional options that just might be helpful here.

On Windows, the Perl-based windchill.exe still remains "the" windchill command for various reasons backwards compatibility reasons, but "windchill2.bat" is available -- except in InService where windchill.exe has been replaced by windchill.bat, which is just a copy of windchill2.bat.

On UNIX, the windchill command's implementation was switched from Perl to Bourne shell.

Announcements


Top Tags