smokin5s Posted January 26, 2010 Report Share Posted January 26, 2010 ok, so I'm trying to do something incredibly simple... but for the life of me, I can't get it to work right... I'm pretty much writing a VBS file that calls an exe... only issue is, the exe has spaces in it's path and won't work... if I take the spaces out of the path, it works fine how do I fix it? Attached is the code that I'm using. The reason why I'm using it is I'm trying to remotely call the exe off of a website... I have the code in there for it to populate the computer name, but for this example, I figure it's just easier to make it call the local host name. ******************************* strComputer = "." strCommand = "C:\Program Files\McAfee\VirusScan Enterprise\mcupdate.exe" Const INTERVAL = "n" Const MINUTES = 1 Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set objScheduledJob = objWMIService.Get("Win32_ScheduledJob") Set objSWbemDateTime = CreateObject("WbemScripting.SWbemDateTime") objSWbemDateTime.SetVarDate(DateAdd(INTERVAL, MINUTES, Now())) errReturn = objScheduledJob.Create(strCommand, objSWbemDateTime.Value, False, 0, 0, True, intJobID) **************************** Quote Link to comment Share on other sites More sharing options...
twistedfocus1647545489 Posted January 26, 2010 Report Share Posted January 26, 2010 My programming skills are weak to none, but I would try %20 in place of the space in that path. Quote Link to comment Share on other sites More sharing options...
96blkform Posted January 26, 2010 Report Share Posted January 26, 2010 """C:\Program Files\McAfee\VirusScan Enterprise\mcupdate.exe""" Double up on the quotes, this will denote the space in the file path. Quote Link to comment Share on other sites More sharing options...
smokin5s Posted January 26, 2010 Author Report Share Posted January 26, 2010 """C:\Program Files\McAfee\VirusScan Enterprise\mcupdate.exe""" Double up on the quotes, this will denote the space in the file path. not in VB world Quote Link to comment Share on other sites More sharing options...
smokin5s Posted January 26, 2010 Author Report Share Posted January 26, 2010 My programming skills are weak to none, but I would try %20 in place of the space in that path. no go Quote Link to comment Share on other sites More sharing options...
smokin5s Posted January 26, 2010 Author Report Share Posted January 26, 2010 looks like it requires 3 "'s which is what I see you did... when you said double up on quotes, I thought you meant 2 quotes reading > me Quote Link to comment Share on other sites More sharing options...
96blkform Posted January 26, 2010 Report Share Posted January 26, 2010 looks like it requires 3 "'s which is what I see you did... when you said double up on quotes, I thought you meant 2 quotes reading > me Sorry I should have said triple. Did it work out ok? Quote Link to comment Share on other sites More sharing options...
smokin5s Posted January 26, 2010 Author Report Share Posted January 26, 2010 yup Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.