I have windows clients working on a linux server.
There are batch files to start the programs. The program itself is a windows executable. The path comes from a samba share and the executable starts under the users login automatically.
The Batch looks like
set lw=A:
if not exists %lw% goto connect
goto start_prog
:connect
NET USE %lw% /delete
NET USE %lw% \\server\progpath
goto start_prog
:start_prog
set XXX=YYY
...
start %lw1%\...\prog.exe -X options
echo ....
So far there is no problem, but to cleanup some files, I would like to delete some configuration data before starting the exe. This can manually be done by
sudo find /... -type f -name ...<userlogin>... -exec rm {} ';'
But how to start such a script by the batchfile?
Where does the shell script gets the username from?
And how to start it as root/sudo?
Server:
Ubuntu, Release 18.04
Clients:
Windows goes from Win10 to Win11