Halp Any Groping Policy experts here?

fly

Osharts 11
Oct 1, 2004
72,326
23,906
1,073
Steam
mattressfish
I'm trying to launch an app via GPO login script, but for the life of me - I can't get it working.

I've tried using a batch file, like this:
Code:
START "" "%ProgramFiles%\Microsoft Office Communicator\Communicator.exe"

and also vbscript, like this:
Code:
Set WshShell = WScript.CreateObject("WScript.Shell")
Command = "%WINDIR%\System32\Calc.exe"
WshShell.Run Command

Both run when I double-click on them from the \Netlogon share. I don't see any errors in the event log. And finally, RSOP.msc shows that the policy should be running. Anyone know what the hell I'm doing wrong???
 

plot

Morning Boehner
Oct 16, 2006
20,031
4,165
323
kansas city
Also, for batch, try
StarT "" "c:\path\whatever" program.exe

start path is seperate from the app I think. I'm in a phone so the typing sucks for a better explanation.
 

fly

Osharts 11
Oct 1, 2004
72,326
23,906
1,073
Steam
mattressfish
Pretty sure its not separate. And it does work when run manually.

As an update, I added an ECHO to a text file. The batch IS running, but its not doing anything for some reason.
 

Sarcasmo

A Taste Of Honey Fluff Boy
Mar 28, 2005
34,396
464
648
44
Austin
Politics is so complicated these days. Whatever happened to lecterns and bluster?
 

JAXvillain

Curly_Sue
Oct 13, 2004
68,542
1,879
923
if you can't get the bat to start the exe how about copying a shortcut to the exe into the startup folder with the bat?
 

plot

Morning Boehner
Oct 16, 2006
20,031
4,165
323
kansas city
in gpoe you can goto local computer policy, computer configuration, administrative templates, system, logon, then click on run these programs at user logon. Good for stuff like communicator....

basically ads the program to currentversion\run in the registry.
 

fly

Osharts 11
Oct 1, 2004
72,326
23,906
1,073
Steam
mattressfish
if you can't get the bat to start the exe how about copying a shortcut to the exe into the startup folder with the bat?
in gpoe you can goto local computer policy, computer configuration, administrative templates, system, logon, then click on run these programs at user logon. Good for stuff like communicator....

basically ads the program to currentversion\run in the registry.

Actually it HAS to run via GPO logon script, so that it DOESN'T run when our road warriors log in with cached credentials.
 

fly

Osharts 11
Oct 1, 2004
72,326
23,906
1,073
Steam
mattressfish
Grrr, it appears that everything is working in this batch file, except for the START command.

(There are also some REG commands that are working without issue.)
 

fly

Osharts 11
Oct 1, 2004
72,326
23,906
1,073
Steam
mattressfish
Let me just post the whole damn thing and see if someone sees my error...

Code:
:::::::::::::::::::::::::::::::::::
:: Microsoft Communicator
::
:: Created: 03/06/09
:: By: Zac 
:::::::::::::::::::::::::::::::::::


ECHO %DATE% %TIME% Running %0 >> c:\logon.log

:: Find OS architecture, so we know which ProgramFiles to check
IF "%ProgramFiles(x86)%XXX" == "XXX" (
	REM This is an x86 OS
	GOTO X86
) ELSE (
	REM This is an x64 OS
	GOTO X64
)
GOTO END

:X86
SET ProgFiles=%ProgramFiles%
ECHO %DATE% %TIME% OS is x86 >> c:\logon.log
GOTO COMMUNICATOR

:X64
ECHO %DATE% %TIME% OS is x64 >> c:\logon.log
SET ProgFiles=%ProgramFiles(x86)%
GOTO COMMUNICATOR

:COMMUNICATOR
ECHO %DATE% %TIME% Checking for Communicator.exe >> c:\logon.log
:: Check that Communicator exists
IF EXIST %ProgFiles%\Microsoft Office Communicator\communicator.exe (
	ECHO %DATE% %TIME% Communicator found at %ProgFiles%\Microsoft Office Communicator\communicator.exe >> c:\logon.log
	
	:: Set Microsoft Communicator policies
		ECHO %DATE% %TIME% Adding Communicator registry settings >> c:\logon.log
	
	:: Kill auto start
		REG DELETE "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v COMMUNICATOR /f
		REG ADD "HKCU\Software\Microsoft\Communicator" /v AutoRunWhenLogonToWindows /t REG_DWORD /d 0 /f

	:: Communicator policies - Steve
		REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Communicator" /v AllowUnencryptedFileTransfer /t REG_DWORD /d 0 /f
		REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Communicator" /v CallLogAutoArchivingPolicy /t REG_DWORD /d 0 /f
		REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Communicator" /v DisableOnlineContextualSearch /t REG_DWORD /d 1 /f
		REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Communicator" /v DisableSavingIM /t REG_DWORD /d 0 /f
		REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Communicator" /v EnableSIPHighSecurityMode /t REG_DWORD /d 1 /f
		REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Communicator" /v EnableURL /t REG_DWORD /d 1 /f
		REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Communicator" /v IMAutoArchivingPolicy /t REG_DWORD /d 1 /f
		REG ADD "HKLM\SOFTWARE\Policies\Microsoft\Communicator" /v TourLaunchMode /t REG_DWORD /d 2 /f

		REG ADD "HKCU\Software\Microsoft\Communicator" /v AutoOpenMainWindowWhenStartup /t REG_DWORD /d 0 /f
		REG ADD "HKCU\Software\Microsoft\Communicator" /v FirstTimeUser /t REG_DWORD /d 0 /f
		REG ADD "HKCU\Software\Microsoft\Communicator" /v TourPlayed /t REG_DWORD /d 1 /f
		 
		REG ADD "HKCU\Software\Policies\Microsoft\Communicator" /v ServerAddressInternal /t REG_SZ /d server.address /f
		REG ADD "HKCU\Software\Policies\Microsoft\Communicator" /v ServerAddressExternal /t REG_SZ /d server.address /f
		REG ADD "HKCU\Software\Policies\Microsoft\Communicator" /v Transport /t REG_DWORD /d 4 /f
		REG ADD "HKCU\Software\Policies\Microsoft\Communicator" /v ConfigurationMode /t REG_DWORD /d 0 /f

	:: Fix Live Meeting over MSVPN
		REG ADD "HKCU\Software\Microsoft\Shared\UcClient" /v Transport /t REG_DWORD /d 4 /f

	:: Start Communicator
		ECHO %DATE% %TIME% Launching Communicator >> c:\logon.log
		START "" "%ProgFiles%\Microsoft Office Communicator\communicator.exe"
)
GOTO END

:END
ECHO %DATE% %TIME% Done! >> c:\logon.log
ECHO. >> c:\logon.log

Everything seems to work, except for the START command.
 
Last edited:

Sarcasmo

A Taste Of Honey Fluff Boy
Mar 28, 2005
34,396
464
648
44
Austin
I don't know, but this is bothering me.

Code:
REM This is an x86 OS
	GOTO X86
) ELSE (
	REM This is a x64 OS
	GOTO X64

The first one says AN x86 and the second one says A x64. Please change.
 

JAXvillain

Curly_Sue
Oct 13, 2004
68,542
1,879
923
chop out the start bit into another bat and simplify it. add things back one at a time until you isolate
 

polo

Flaccid Member
Aug 1, 2007
7,456
26
0
how could you not know if there's any group policy experts here?

don't most of these fuckers live in your house at the weekend?
 

Josh

Biff Clurton
Oct 9, 2006
7,408
3,750
273
East bumfuck.
Is it because START doesn't understand what the variable %progfiles% is? I am not 100% sure you can pass a variable to START.
You may need to just run the communicator.exe under :X86 and :X64 without having to pass on the variable.

edit, possibly rewrite it so that you have IF EXIST "c:\program files(x86)"
commands for 64bit stuff
ELSE
commands for 32bit stuff
 
Last edited:

fly

Osharts 11
Oct 1, 2004
72,326
23,906
1,073
Steam
mattressfish
how could you not know if there's any group policy experts here?

don't most of these fuckers live in your house at the weekend?
:lol:
Is it because START doesn't understand what the variable %progfiles% is? I am not 100% sure you can pass a variable to START.
You may need to just run the communicator.exe under :X86 and :X64 without having to pass on the variable.

edit, possibly rewrite it so that you have IF EXIST "c:\program files(x86)"
commands for 64bit stuff
ELSE
commands for 32bit stuff

I'll try this, but you can definitely pass the variable, because it works when I manually run it. And really, START shouldn't care, since DOS is interpreting that before its even passed to START
 

plot

Morning Boehner
Oct 16, 2006
20,031
4,165
323
kansas city
you can definitely pass variables to start.


so its finding communicator, setting the reg keys, just not starting communicator?