I’m trying to use RunAsCurrentUser v2.0 and having issues.
I do not receive any errors it just won’t execute the program (batch file).
This is my ActionScrip: (Have the download command downloading the util)
delete “c:\temp\Copy this file.resource”
copy “{(pathname of client folder of current site) & “__Download\Copy this file.resource”}” “c:\temp\Copy this file.resource”
delete “c:\temp\Copy this file.resource.xml”
copy “{(pathname of client folder of current site) & “__Download\Copy this file.resource.xml”}” “c:\temp\Copy this file.resource.xml”
delete __appendfile
appendfile @echo off
appendfile copy “c:\temp\Copy this file.resource” “c:\documents and settings%username%\My Documents\Software\Content\Copy this file.resource” /y
appendfile copy “c:\temp\Copy this file.resource.xml” “c:\documents and settings%username%\My Documents\Software\Content\Copy this file.resource.xml” /y
delete copyfile.bat
copy __appendfile copyfile.bat
wait “{(pathname of client folder of current site) & “__Download\RunAsCurrentUser-2.0.exe”}” --r “c:\temp\copyfile.bat”
I have verified that all files are copied where they should be. The .bat file is created and copied with no problems. I can double-click on the coped .bat file and it runs as needed.
The file is in the c:\temp directory because i copied it there from the __Download folder. I’ve check to make sure that the file is in c:\temp and it works fine if executed manually. But, won’t run when i pass it to the RunAsCurrentUser.
If I execute the RunAsCurrentUser thru a .bat file from my desktop should it execute the program as it would if I ran it thru a Fixlet?
I’m guessing Choro is testing a manually copied a copyfile.bat to c:\temp and kicked off the action. So the action creates a file that’s not used and rather uses a file that’s present.
His last question asks if he can try using RunAsCurrentUser.exe in his own personal .bat file to see if it works (without using BigFix at all). I guess you could as long as you launch it as the system account? I don’t know if you can run that as just a local admin. If so, (and it’s Vista), you’ll have to at least run it as administrator.
Choro – I’m guessing your problem might be that your not downloading RunAsCurrentUser-2.0.exe at all. Try adding the following to the beginning of your action. Also change your line that run RunAsCurrentUser-2.0.exe and make it just RunAsCurrentUser.exe.
I had many issues with run as current user - especially if my batch file uses STDIN or STDOUT, so make sure that your script is “quiet”.
so, try:
delete __appendfile
appendfile @echo off
appendfile copy “c:\temp\Copy this file.resource” “c:\documents and settings%username%\My Documents\Software\Content\Copy this file.resource” /y >NUL 2>&!
appendfile copy “c:\temp\Copy this file.resource.xml” “c:\documents and settings%username%\My Documents\Software\Content\Copy this file.resource.xml” /y >NUL 2>&!
delete copyfile.bat
copy __appendfile copyfile.bat
wait “{(pathname of client folder of current site) & “__Download\RunAsCurrentUser-2.0.exe”}” --w “{(pathname of client folder of current site)}\copyfile.bat”