jbennett Posted October 15, 2008 Share Posted October 15, 2008 (edited) Hi everyone, I've got a problem with opening a .lnk file in AutoIT and can't seem to solve the problem :-( I'm trying to open a .lnk file from a server location on the local machine. e.g. server.something.local\c\work\backup\workbackup.lnk This works fine until I put the AutoIT .exe file into a scheduled task created with the AT command and I have no idea why this occurs? If I manually create the scheduled task with the local user then there is no problem Does anyone know the correct code to open a .lnk file within a scheduled task? Many thanks Edited October 15, 2008 by jbennett Link to comment Share on other sites More sharing options...
Mojo Posted October 15, 2008 Share Posted October 15, 2008 Hi everyone, I've got a problem with opening a .lnk file in AutoIT and can't seem to solve the problem :-( I'm trying to open a .lnk file from a server location on the local machine.e.g. server.something.local\c\work\backup\workbackup.lnkThis works fine until I put the AutoIT .exe file into a scheduled task created with the AT command and I have no idea why this occurs?If I manually create the scheduled task with the local user then there is no problemDoes anyone know the correct code to open a .lnk file within a scheduled task?Many thanksWhy not just start the exe then, if .lnk doesn't work?I know I once had a similar problem with running a script in a scheduled task, but that had to do with Interactive or not.If you need the "start minimized" or so, options, you could create a script that basically does what the .lnk does, compile it and add that compiled exe in a scheduled task. You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
jbennett Posted October 15, 2008 Author Share Posted October 15, 2008 (edited) The only problem is that the .lnk file has some extra information within it, hence the reason for using the .lnk In the target of the .lnk file there is additional information at the end. "server1.system.local" Edited October 15, 2008 by jbennett Link to comment Share on other sites More sharing options...
Mojo Posted October 15, 2008 Share Posted October 15, 2008 Doesn't really matter! You can just select the exe (if you do it with "schedule a new task") and then add the parameters at the end of the line, like: defrag.exe C:\ /f Of course, if there are spaces in the path to the exe you need "..." : "C:\some long path with spaces in it\defrag.exe" C:\ /f You don't even need an autoit script for that. But you can if you like. You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
jbennett Posted October 15, 2008 Author Share Posted October 15, 2008 So I could create a scheduled task like the following: server1.system.local\backup\network\backup.cmd "server1.system.local" Does that sound correct? thanks Link to comment Share on other sites More sharing options...
Mojo Posted October 15, 2008 Share Posted October 15, 2008 Yes, I would say so. or... server1.system.local\backup\network\backup.cmd server1.system.local -> that should work too, as long as there are no spaces in the parameters to pass. you can just copy the entire "target" line from the shortcut and paste it in the scheduler. Try it, it will work. You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
jbennett Posted October 15, 2008 Author Share Posted October 15, 2008 Cool that works. The only problem is that when using the AT command to create the schedule it doesn't work. I manually run the schedule created with the AT command and a cmd pops up for a split second and nothing happens.Hmm Any ideaS? Thanks Link to comment Share on other sites More sharing options...
Mojo Posted October 15, 2008 Share Posted October 15, 2008 (edited) it may have to do with the "Interactive" feature. Don't know how you did the AT cmd and if it is Interactive per default or not, but that might be it. Create the task with the wizard and check [EDIT: check, not in the sense of enabling all the options, but "view and remember" ! ] all the options once the task works as it should. Then try to create an AT command so that those two tasks look exactly the same. Good luck Edited October 15, 2008 by Mojo You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
jbennett Posted October 15, 2008 Author Share Posted October 15, 2008 (edited) This is my AT del c:\windows\tasks\Scheduled_Backup.jobif not exist c:\windows\tasks\Scheduled_Backup.job at 00:00 /interactive /every:M,T,W,T,F,S,SU \\server.system.local\workBackup\Project2\Network\BakZIPs\userBackup.cmd "\\server.system.local"rename C:\Windows\tasks\At1.job Scheduled_Backup.jobIt seems like the PCs don't like the NT AUTHORITY/SYSTEM account that the AT command uses.UPDATE-------Checked all the options and everything is the same apart from the RUN AS bit.The manual scheduled task has the local user name, where as the AT has the NT AUTHORITY/SYSTEM account.I need to use the NT AUTHORITY/SYSTEM account that as i'm rolling this out to lots of PCs Edited October 15, 2008 by jbennett Link to comment Share on other sites More sharing options...
Mojo Posted October 15, 2008 Share Posted October 15, 2008 have you tried without "/Interactive" ? Because I think the SYSTEM in most cases is never really logged on, but always in the background. You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
jbennett Posted October 15, 2008 Author Share Posted October 15, 2008 Yeah I tried without /interactive You don't think this is a permission issue on the server?. I logged in to the SYSTEM account and couldn't access any of the network shares. Hmm Link to comment Share on other sites More sharing options...
Mojo Posted October 15, 2008 Share Posted October 15, 2008 Yeah that makes sense. Wouldn't be so funny if the local SYSTEM account could access every other machine as if it was that machine's SYSTEM account. But if you add "Everyone" to the share(s) you need, it should work, I guess. You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
jbennett Posted October 15, 2008 Author Share Posted October 15, 2008 I will give it a try but I have a bad feeling about this. Wish the AT command could specify another user other than the SYSTEM account. I just need to ensure that it's locked down and the same on every PC Link to comment Share on other sites More sharing options...
Mojo Posted October 15, 2008 Share Posted October 15, 2008 You CAN specify another user. If not with AT then definitely with schtasks (which is the new AT). You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
jbennett Posted October 15, 2008 Author Share Posted October 15, 2008 Do you know how to use schtask?I've had a look but it really confuses me.You CAN specify another user. If not with AT then definitely with schtasks (which is the new AT). Link to comment Share on other sites More sharing options...
jbennett Posted October 15, 2008 Author Share Posted October 15, 2008 (edited) SCHTASKS /Create /SC weekly /D MON,TUE,WED,THU,FRI /TN MyDailyBackup /ST 23:00:00 /TR \\server.system.local\workBackup\Project2\Network\BakZIPs\userBackup.cmd "\\server.system.local" /RU MyDomain\MyLogin /RP MyPasswordSCHTASKS /Delete /TN "MyDailyBackup" /fI presume this is the type of code to use.The problem is now with the "\\server.system.local" piece of codePlus the scheduled task "run as" just defaults to the current logged in user :-( Edited October 15, 2008 by jbennett Link to comment Share on other sites More sharing options...
jbennett Posted October 15, 2008 Author Share Posted October 15, 2008 solved that problem with the user account The only problem I now have is the additional info bit "server.system.local" Do you know where I would paste this? thanks Link to comment Share on other sites More sharing options...
Mojo Posted October 15, 2008 Share Posted October 15, 2008 perhaps /U and /P instead of /RU and /RP -> the ones with /Rx seem to be for "remote" but I don't know for sure. I barely ever used it before. You'll just have to try different things and perhaps search the internet. Definitely not an AutoIt related problem anymore The "\\server.system.local" thingy might work if you remove the ' " ' signs. (don't know their name in english ;-) ) So, I wish you luck... I have to do some work now ;-) cheers You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
jbennett Posted October 15, 2008 Author Share Posted October 15, 2008 thanks :-) Link to comment Share on other sites More sharing options...
Mojo Posted October 15, 2008 Share Posted October 15, 2008 you're welcome You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
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