GRitchie Posted February 5, 2015 Posted February 5, 2015 Hello, I've got a script deployed via a GPO to run on logon, however it only seems to be doing the first step? The script is the following: @echo on xcopy "\\SERVER-IP\IT\Software\Necessary\SchoolNameApplication\SchoolNameTrayInstaller.exe*" "C:\Users\%username%\Desktop\" /y TIMEOUT /T 1 start "SchoolNameTrayInstaller.exe" /D "C:\Users\%username%\Desktop" "SchoolNameTrayInstaller.exe" It will run the xcopy command and successfully copies this to the desktop. It does not, however, execute the 'start' command. When running the same batch file manually when logged in, it completes successfully. Any clues?
Patrick Posted February 5, 2015 Posted February 5, 2015 Is it a permission issue when it comes to executing the file?
GRitchie Posted February 6, 2015 Author Posted February 6, 2015 Is it a permission issue when it comes to executing the file? Nope Permissions are all fine. I tried it with a 'call' command - this doesn't work either? It's as though from a logon script it doesn't like starting a new program/calling another script.
Arthur Posted February 6, 2015 Posted February 6, 2015 (edited) Do any of these work? The first one should. start "" "%USERPROFILE%\Desktop\SchoolNameTrayInstaller.exe" start "" /D "C:\Users\%username%\Desktop" /wait "SchoolNameTrayInstaller.exe" start "" /D "%USERPROFILE%\Desktop" /wait "SchoolNameTrayInstaller.exe" I've got a script deployed via a GPO to run on logon, however it only seems to be doing the first step? Wouldn't your users be prevented from running executables due to SRP or AppLocker? Edited February 6, 2015 by Arthur
pleach85 Posted February 6, 2015 Posted February 6, 2015 Try the following @echo on xcopy "\\SERVER-IP\IT\Software\Necessary\SchoolNameApplication\SchoolNameTrayInstaller.exe*" "C:\Users\%username%\Desktop\" /y TIMEOUT /T 1 "%userprofile%\Desktop\SchoolNameTrayInstaller.exe" I don't think you need start or call, plus I find %userprofile% is better than C:\users\%username% but if that doesn't suit your environment ignore me!
andydis Posted February 6, 2015 Posted February 6, 2015 start "SchoolNameTrayInstaller.exe" /D "C:\Users\%username%\Desktop" "SchoolNameTrayInstaller.exe" this is wrong my start.exe doesnt even have a /D switch , where did you get that from?
Arthur Posted February 6, 2015 Posted February 6, 2015 my start.exe doesn't even have a /D switch , where did you get that from? Mine does. http://a.pomf.se/ibmwjn.png
Patrick Posted February 6, 2015 Posted February 6, 2015 (edited) I've had issues before when asking a logon script to execute a file. Weirdly, I created a scheduled task to run a basic script of the application. By basic I mean "\\server\software\file.exe" -arguments I set the scheduled task to run that as a batching file at logon and as an administrator and it worked. I'm not saying it'll work for you, i'm just saying that logon scripts have acted up for me before. Edited February 6, 2015 by Patrick
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now