(imported topic written by brolly3391)
I feel dumb…but this still doesn’t work for me. I’ve tried quite a few different things with no luck. At the moment, I use a .bat file to copy three files to a new directory on the C: drive (another .bat file and 2 supporting files). I then download and execute “RunAscurrentuser.exe” and tell it to execute the .bat file. No luck. Doesn’t even appear to run, but no errors.
I have to copy/edit two files that happen to sit under each users “documents and settings” folder so I have to detect who the user is to copy correctly. Below is my action script and the .bat file.
download http://server.thatplace.com:52311/Uploa … /big28.tmp
continue if { (size of it = 36350 and sha1 of it = “2984dfdfa1c4d2d79d28d2a311f61faf7f6fe4a3”) of file “big28.tmp” of folder “__Download”}
extract big28.tmp
wait “{pathname of system folder & “\cmd.exe”}” /C “{(pathname of client folder of current site) & “__Download\preupd.bat”}”
download http://support.bigfix.com/download/bes/ \u2026 ntUser.exe
continue if {(size of it = 69632 AND sha1 of it = “9bf587d2d4a81e1d8c179ade6a4daf64daa0db31”) of file “RunAsCurrentUser.exe” of folder “__Download”}
wait __Download/RunAsCurrentUser.exe --w cmd.exe /C c:\jdeupdate\jdeupd.bat /change
The .bat file looks like this:
cd c:\jdeupdate
type jdeupd.txt >> c:\Docume~1%USERNAME%\Applic~1\ICAClient\APPSRV.ini
copy Peoplesoft.lnk c:\Docume~1%USERNAME%\Desktop\Peoplesoft.lnk
Things work fine if I change the %USERNAME% variable to a real username (but that obviously won’t work for 1000 people).
Any help is appreciated as I need to provide an answer Monday morning.
Thanks,
Tim
Tim,
It does not look like you are trying to do anything that requires you to run as user. Let’s avoid the issue and change things around just a little to use relevance to get the name of your current user instead of using an environment variable in your bat file. I suspect that your preupd.bat is probably the source of the issue that you are running into.
relevance:
exists current user AND (other stuff)
action:
download http://server.thatplace.com:52311/Uploa … /big28.tmp
continue if { (size of it = 36350 and sha1 of it = “2984dfdfa1c4d2d79d28d2a311f61faf7f6fe4a3”) of file “big28.tmp” of folder “__Download”}
extract big28.tmp
dos type __Download\jdeupd.txt >>“c:\Documents and settings{name of current user}\Application data\ICAClient\APPSRV.ini”
delete “c:\Documents and settings{name of current user}\Desktop\Peoplesoft.lnk”
copy __Download\Peoplesoft.lnk “c:\Documents and settings{name of current user}\Desktop\Peoplesoft.lnk”
That should take care of your update for the currently logged on user. You might run into issues using type>> to update that ini file as it’s easy to end up with duplicate entries and headings by appending to what is there already. But, I don’t really have a better way to perform an .ini file edit using action language or getting really convoluted in a bat file.