start /wait - use wildcards
Hi,

I have a really simple script and it works great on the RDS server.

--start of script--
start /wait C:\Windows\System32\calc.exe
logoff.exe
--end of script--

The problem I have now is that calc.exe might be calc_v2.exe or calc_v3.exe. Can I use a wildcard to represent say calc_*.exe?

Thanks
August 21st, 2015 2:51pm

Not without using a for loop.

Perhaps it would help if you would explain the purpose/goal.

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 2:56pm

When the user logs in to the terminal server, the tslogoff.bat script runs and calls the program calc.exe. When they close calc.exe, the terminal server session closes.

But now we have updates to calc.exe. When you run the script it calls calc.exe and it checks if there are any updates and if there are it will run calc_v2.exe and if there isn't any it will run calc.exe.

The problem with this is that when calc_v2.exe runs, calc.exe is not running anymore and the user gets logged off.

How can I update the script so it works for calc.exe and eg. calc_v2.exe, calc_v3.exe, etc.?

Thanks

August 21st, 2015 3:32pm

Trying to apply policies using a script is not a good idea because it can by bypassed pretty easily.

This sounds like a terminal server or a GPO application whitelisting configuration question.

Explain the "big picture" purpose/goal, not how you think a script is supposed to accomplish it. For example: We want for users to have access only to a single executable when they log onto a terminal server.

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 4:17pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics