This forum uses cookies. Click X button to hide this message. What is stored? / Privacy
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Shell command to set system variable

 
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander (English) Printable version
View previous topic :: View next topic  
Author Message
reekydeeky
Junior Member
Junior Member


Joined: 10 Jan 2014
Posts: 10

PostPosted: Mon Jun 11, 2018 3:02 am    Post subject: Shell command to set system variable Reply with quote

Hello folks Smile
Does anyone know a way to set a system variable from TC ? (windows)

eg (in cmd prompt) setx CurrentProject c:\projects\currentProject_XX

I can't find a way to set %CurrentProject% = [TC source] as a button.


In Maya it's invaluable (done via Python) as we're jumping between projects all the time. Would love to be able to do the same thing in TC
Back to top
View user's profile Send private message
Stefan2
Power Member
Power Member


Joined: 13 Sep 2007
Posts: 1928
Location: Europa

PostPosted: Mon Jun 11, 2018 3:36 am    Post subject: Reply with quote

Me guess:


Command: cmd /c
Parameters: setx CurrentProject %P


If that is the correct syntax for setx.



In opened button dialog, press F1 for more help...
Test:
Command: cmd /k
Parameters: ECHO %P



 
_________________
The destination is one thing. Getting there is everything.
Back to top
View user's profile Send private message
reekydeeky
Junior Member
Junior Member


Joined: 10 Jan 2014
Posts: 10

PostPosted: Mon Jun 11, 2018 3:52 am    Post subject: Reply with quote

Perfect !! Thank you Stefan 2
(it was the /c that I was missing .. you're a hero)
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 8037
Location: Russian Federation

PostPosted: Mon Jun 18, 2018 3:51 am    Post subject: Reply with quote

I believe that it would be better to quote %P to make it working with paths that contain spaces:
Code:
Command: cmd.exe /c
Parameters: setx CurrentProject "%P"

_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander (English) All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Imprint/Impressum: This site is maintained by Ghisler Software GmbH
Privacy Policy | Datenschutzerklärung | Politique de Confidentialité

Using phpBB © phpBB Group