2

In our office we are using Linux thin client machines, they work very well except the lack of IE, which is a pain because the corporations we deal with are too stupid to update their web apps (no flame wars please).

To solve this problem we have machine in our computer room which users remote desktop into to access internet explorer, this is achieved by running a batch script which opens IE and when it closes logs them off, this setup works well for us.

Even though I have @echo off and the cmd window isn't displaying anything, I would really like that batch file to be executed silently, so the cmd window doesn't appear at all.

Is this possible?

The Ubuntu terminal server client has an option to launch a file / app at login, is there a command I can use to run this batch silently.

I have tried these:

C:\my_batch.bat /NOCONSOLE
C:\my_batch.bat /NOWINDOW
C:\my_batch.bat /B
C:\my_batch.bat /Q

...with no success, perhaps it's the way I am doing it?

Cheers :-)

Edit

The remote desktop platform is a Windows XP machine, nothing entirely special but not a Windows Server setup.

Ben Everard
  • 569
  • 3
  • 7
  • 21
  • 1
    It's kind of lame to toss out an insult but then proclaim "no flame wars". You are the folks doing the weird stuff. Asking for help fixing the problem is great, but don't insult others for not accommodating your non-standard configuration. If you don't want the heat, stay out of the kitchen! – tomjedrz Feb 18 '10 at 21:04
  • What would you call a standard configuration? I would think it would be better for organisations to ensure their web applications comply with the web standards, therefore ensuring their proper use regardless of platform or browser ;-) – Ben Everard Feb 19 '10 at 08:35

5 Answers5

3

Perhaps try

start /b my_batch.bat

the /b parameter is used to

Start application without creating a new window. The
application has ^C handling ignored. Unless the application
enables ^C processing, ^Break is the only way to interrupt
the application
smoak
  • 646
  • 2
  • 7
  • 13
3

Instead of using a batch file, why don't you create a Group Policy that forces the user shell to be Internet Explorer. This should achieve the behavior you want without any scripts at all.

user configuration -> administrative templates-> system -> custom user interface

Another alternative would be create a vbscript and use that via thw windows scripting host instead of a batch file. Scripts launched with wscript will not spawn a new window. What is your batch file doing? It should be easy enough to simply convert it WSH.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
0

If you don't mind the batch file executing whenever any user logs on (i.e. via terminal services or locally), then:

  1. Save your .cmd file to a location where all users have read only access. (e.g. %WINDIR%)
  2. Launch gpedit.msc from a command prompt
  3. Navigate to User > Security > Scripts > Logon
  4. Add a new script, and point it to wherever you saved your .cmd file

The script should run silently without showing a command prompt window.

If you don't want it to run when a user logs on locally, it is probably possible to detect this in your batch file and silently abort the script.

Bryan
  • 7,538
  • 15
  • 68
  • 92
  • Disclaimer: The path in step 3 is from memory, as I don't have a windows PC in front of me to check. – Bryan Feb 18 '10 at 17:22
0

You can't run a batch script hidden if run it like this. But it's possible with a little VBS.

Just execute the VBS file and it will run the Script hidden

Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "cmd /C C:\my_batch.bat",0,false
Set oShell = Nothing

See this msdn article: http://msdn.microsoft.com/en-us/library/d5fk67ky%28VS.85%29.aspx

grub
  • 1,118
  • 1
  • 7
  • 11
0

The remote desktop application is in fact using said batch file as an alternate shell, and I don't think parameters can be passed using this method.

Therefore I will have to live with my console window.

Ben Everard
  • 569
  • 3
  • 7
  • 21