﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>The VNC Manager - SmartCode Solutions Forum / General Discussion / SmartCode VNC Manager  / Small troubles with %userprofile% and %appdata% environment variables / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>The VNC Manager - SmartCode Solutions Forum</description><link>http://vncmanager.com/forum/</link><webMaster>forums@s-code.com</webMaster><lastBuildDate>Sat, 20 Mar 2010 03:49:51 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Small troubles with %userprofile% and %appdata% environment variables</title><link>http://vncmanager.com/forum/Topic1496-3-1.aspx</link><description>It's not a bug. The reason why %USERPROFILE% returns such value is because a temporary windows service created by Remote Exec on a target computer runs under LocalSystem account. I don't remember exactly why it was implemented this way, but I'm sure there was a reason. If I recon it correctly one of the reasons was msiexec.exe. Msiexec wouldn't install an application correctly if the host service would be running not under LocalSystem account. Anyway, I think in v4.0 we will make this it as a configurable option; so a user would be able to specify which account type to use for the temporary service.&lt;/P&gt;&lt;P&gt;As I workaround...may be you could try to use "runas" command in your script?!</description><pubDate>Wed, 13 Jun 2007 21:51:45 GMT</pubDate><dc:creator>Support (s-code)</dc:creator></item><item><title>Small troubles with %userprofile% and %appdata% environment variables</title><link>http://vncmanager.com/forum/Topic1496-3-1.aspx</link><description>Hi, this is me :D !&lt;br&gt;&lt;br&gt;I've a little strange problem using %userprofile% and %appdata% environment variable in a Batch script (.bat). The script is local, and must be executed on a remote computer :&lt;br&gt;&lt;br&gt;[quote]&lt;br&gt;@echo off&lt;br&gt;&lt;br&gt;echo Userprofile : %userprofile%&lt;br&gt;echo AppData : %appdata%&lt;br&gt;[/quote]&lt;br&gt;&lt;br&gt;This script is necessary to cpy shortcuts (.lnk) in he Starting folder of Windows and in the task bar (led by Internet Explorer, from %appdata%).&lt;br&gt;&lt;br&gt;The script works well if I execute it on my local computer.&lt;br&gt;The script works well if I copy it manually on the remote computer (running from my desk to the remote computer wuith a USB disk :P), and returns me the following :&lt;br&gt;[quote]&lt;br&gt;Userprofile : C:\Document and Settings\Administrateur&lt;br&gt;AppData : C:\Document and Settings\Administrateur\Application Data&lt;br&gt;[/quote]&lt;br&gt;&lt;br&gt;But if I use smartCode to execute the script on the rmote computer, I get :&lt;br&gt;[quote]&lt;br&gt;Userprofile : C:\Documents and Settings\Default User&lt;br&gt;AppData : &lt;br&gt;[/quote]&lt;br&gt;&lt;br&gt;The user name used to loggin on the remote computer is "Administrateur", of course ;)&lt;br&gt;&lt;br&gt;Is it a bug ?</description><pubDate>Wed, 13 Jun 2007 10:40:28 GMT</pubDate><dc:creator>Nyphel</dc:creator></item></channel></rss>