{"id":1396,"date":"2017-12-04T08:57:50","date_gmt":"2017-12-04T08:57:50","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1396"},"modified":"2020-01-09T09:37:04","modified_gmt":"2020-01-09T09:37:04","slug":"how-to-copy-file-into-windowstemp-folder-rather-than-user-temp-folder","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-to-copy-file-into-windowstemp-folder-rather-than-user-temp-folder\/","title":{"rendered":"How to copy file into WindowsTemp folder rather than User temp folder"},"content":{"rendered":"<p><strong>deployexpert created the topic: How to copy file into WindowsTemp folder rather than User temp folder<\/strong><br \/>\nHi<\/p>\n<p>I am preparing an MSI from SetupCapture in WSP. File is being captured and placed in Temp folder.<\/p>\n<p>I am having big time trouble though the task looks simple.<\/p>\n<p>I want to copy the file into c:\\winnt\\temp folder but the file is getting copied into %Temp% folder which is c:\\docuements and settings\\userid\\Local Settings\\Temp.<\/p>\n<p>I tried to with ALLUSERS=1 commandline and also with Movetable option in MSI but nothing is working out.<\/p>\n<p>Please help me<\/p>\n<p><strong>applicationPackaging replied the topic: Re: How to copy file into WindowsTemp folder rather than User temp folder<\/strong><br \/>\nHave you checked on the TempFolder entry in the Directory table? You should be able to modify the full directory value in that row to whatever temp folder you&#8217;d like. Additionally, if you&#8217;re using the tables to copy files, you should use [TempFolder] instead of %temp% to copy files, that will use the path set in the database, not the environment variable on the target machine.<\/p>\n<p><strong>deployexpert replied the topic: Re: How to copy file into WindowsTemp folder rather than User temp folder<\/strong><br \/>\nHi Jsaylor,<\/p>\n<p>thank you very much for your response.<\/p>\n<p>Below is the directory table row content for TempFolder.<\/p>\n<p>Directory          Directory_Parent    DefaultDir  FullDirectory<br \/>\n&#8220;TempFolder&#8221;  &#8220;WindowsFolder&#8221;    &#8220;.:Temp&#8221;    &#8220;Windows\\Temp&#8221;<\/p>\n<p>I could not able to edit the FullDirectory column. Could you please help me more?<\/p>\n<p>Regards,<br \/>\nWSP<\/p>\n<p>(in reply to Jsaylor)<\/p>\n<p><strong>applicationPackaging replied the topic: Re: How to copy file into WindowsTemp folder rather than User temp folder<\/strong><br \/>\nThat&#8217;s what it should look like, if you want it to go to c:\\winnt\\temp. I would guess that whatever action is copying those files is using the environment variable %temp% instead of the MSI property [tempfolder].<\/p>\n<p>How are you copying the files you want in the system temp folder? With an embedded script in a custom action? If so, you may have to re-evaluate how you&#8217;re populating those files, and perhaps switch them over to using the native windows installer file copying methods.<\/p>\n<p>For instance, if you&#8217;re using the tables, you should be able to go to the component table, find the file (or files) that you want copied, and simply change the entry in the Directory_ column to read &#8220;TempFolder&#8221;. That will tell Windows Installer to put that particular file in c:\\windows\\temp.<\/p>\n<p><strong>deployexpert replied the topic: Re: How to copy file into WindowsTemp folder rather than User temp folder<\/strong><br \/>\nI am using the Installation Expert wizard to copy the file. Just added the file in Windows\\Temp folder and expected that the file will be copied in to the Windows Temp folder but it is not.<\/p>\n<p>When I looked MSI Log, the component is having the Keypath as %temp% folder path. If we can change this to windows temp folder then I think it will copy into the windows temp folder.<\/p>\n<p>Any thoughts on how to change the KeyPath value for that component.<\/p>\n<p><strong>applicationPackaging replied the topic: Re: How to copy file into WindowsTemp folder rather than User temp folder<\/strong><br \/>\nDo you really need those files?<br \/>\nFiles located in the temp folder are for the most temporary files.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>deployexpert created the topic: How to copy file into WindowsTemp folder rather than User temp folder Hi I am preparing an MSI from SetupCapture in WSP. File is being captured&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[49],"tags":[335],"class_list":["post-1396","post","type-post","status-publish","format-standard","hentry","category-general","tag-windowstemp"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=1396"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1396\/revisions"}],"predecessor-version":[{"id":1397,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1396\/revisions\/1397"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=1396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=1396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=1396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}