Jump to content

I need help with a Batch File command and Google is not being nice. SchTasks is the problem and subject.

Hi guys, 

To cut to the chase, here is my batch file, real simple:

@[member='Echo'] offSchTasks /Create /SC DAILY /TN “Thunderbird Email backup” /TR “U:\Thunderbird Email Backup.bat” /ST 21:00 /Fpause

What it is supposed to do is to create a Scheduled Task named "Thunderbird Email Backup" to run the Batch File "Thunderbird Email Backup.bat" at 9:00PM every day. The pause is to see that. 

Now, here is the error I get in the command prompt:

ERROR:Invalid argument/option -- 'Email'.Type "SCHTASKS /CREATE /?" for usage.Press any key to continue...

Now, here is another batch file that I run that works perfectly fine:

@[member='Echo'] offSchTasks /Create /SC DAILY /TN “Shutdown” /TR “C:\Windows\System32\shutdown.exe” /ST 21:00 /F

No pause as it works fine.

So... Why is it cutting it off at Email? Because of the space in the directory? I have "s, so that makes no sense. 

I even tried 's within the "s as that was on a page I found. 

*confused*

Thanks,
Vitalius.

P.S.

I currently have this bypassed by way of this command:

xcopy U:\*.bat C:\

Then change the U to a C in the original, non-working, Batch file. However, I would prefer to not have to do this. 

† Christian Member †

For my pertinent links to guides, reviews, and anything similar, go here, and look under the spoiler labeled such. A brief history of Unix and it's relation to OS X by Builder.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Hi guys, 

To cut to the chase, here is my batch file, real simple:

@[member='Echo'] offSchTasks /Create /SC DAILY /TN “Thunderbird Email backup” /TR “U:\Thunderbird Email Backup.bat” /ST 21:00 /Fpause

What it is supposed to do is to create a Scheduled Task named "Thunderbird Email Backup" to run the Batch File "Thunderbird Email Backup.bat" at 9:00PM every day. The pause is to see that. 

Now, here is the error I get in the command prompt:

ERROR:Invalid argument/option -- 'Email'.Type "SCHTASKS /CREATE /?" for usage.Press any key to continue...

Now, here is another batch file that I run that works perfectly fine:

@[member='Echo'] offSchTasks /Create /SC DAILY /TN “Shutdown” /TR “C:\Windows\System32\shutdown.exe” /ST 21:00 /F

No pause as it works fine.

So... Why is it cutting it off at Email? Because of the space in the directory? I have "s, so that makes no sense. 

I even tried 's within the "s as that was on a page I found. 

*confused*

Thanks,

Vitalius.

P.S.

I currently have this bypassed by way of this command:

xcopy U:\*.bat C:\

Then change the U to a C in the original, non-working, Batch file. However, I would prefer to not have to do this. 


@[member='Echo'] off	SchTasks /Create /SC DAILY /TN Thunderbird Email backup /TR U:\Thunderbird Email Backup.bat /ST 21:00 /F	pause

 

There's your problem, the space in the name "Thunderbird Email Back.bat" you should rename it to Thunderbird_Email_Backup.bat

and change the code to respect this change ^_^ it seems that the program is detecting the Email as an argument

Console optimisations and how they will effect you | The difference between AMD cores and Intel cores | Memory Bus size and how it effects your VRAM usage |
How much vram do you actually need? | APUs and the future of processing | Projects: SO - here

Intel i7 5820l @ with Corsair H110 | 32GB DDR4 RAM @ 1600Mhz | XFX Radeon R9 290 @ 1.2Ghz | Corsair 600Q | Corsair TX650 | Probably too much corsair but meh should have had a Corsair SSD and RAM | 1.3TB HDD Space | Sennheiser HD598 | Beyerdynamic Custom One Pro | Blue Snowball

Link to comment
Share on other sites

Link to post
Share on other sites


  1. @Echo off
  2. SchTasks /Create /SC DAILY /TN “Thunderbird Email backup” /TR “U:\Thunderbird Email Backup.bat” /ST 21:00 /F
  3. pause

 

There's your problem, the space in the name "Thunderbird Email Back.bat" you should rename it to Thunderbird_Email_Backup.bat

and change the code to respect this change ^_^ it seems that the program is detecting the Email as an argument

 

That is what I figured. I am trying that now (read: tomorrow lol). Thanks. 

I have like 40+ user computers I have to make universal changes on and every single one of them has a scheduled task to run Thunderbird Email Backup.bat at a certain time each day. 

I am using that to propagate the changes throughout everyone's system, but I want to make some "quality of life" changes for new people coming in and going "why is this here? What does it do?" among other things.

† Christian Member †

For my pertinent links to guides, reviews, and anything similar, go here, and look under the spoiler labeled such. A brief history of Unix and it's relation to OS X by Builder.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

That is what I figured. I am trying that now (read: tomorrow lol). Thanks. 

I have like 40+ user computers I have to make universal changes on and every single one of them has a scheduled task to run Thunderbird Email Backup.bat at a certain time each day. 

I am using that to propagate the changes throughout everyone's system, but I want to make some "quality of life" changes for new people coming in and going "why is this here? What does it do?" among other things.

You should try out using some kind of cloud storage to allow you to update all 40+ BAT files in 1 smooth motion :P it'd save you a lot of time

Console optimisations and how they will effect you | The difference between AMD cores and Intel cores | Memory Bus size and how it effects your VRAM usage |
How much vram do you actually need? | APUs and the future of processing | Projects: SO - here

Intel i7 5820l @ with Corsair H110 | 32GB DDR4 RAM @ 1600Mhz | XFX Radeon R9 290 @ 1.2Ghz | Corsair 600Q | Corsair TX650 | Probably too much corsair but meh should have had a Corsair SSD and RAM | 1.3TB HDD Space | Sennheiser HD598 | Beyerdynamic Custom One Pro | Blue Snowball

Link to comment
Share on other sites

Link to post
Share on other sites

You should try out using some kind of cloud storage to allow you to update all 40+ BAT files in 1 smooth motion :P it'd save you a lot of time

I have a batch file that overwrites all of them. 

The structure is simple. U:\ is the Users drive (to store work related documents). Every employee has a folder in that drive with their name on it. Using the * character, I just have it put 1 of the batch file in every folder and force overwrite. Deleting it completely though, that I have to do manually (looking into a simple way to do that).

Installing stuff is something I prefer not to do. Yeah, I could install Google Drive or Skydrive on it, but then I have to make an account. And ... just no.

† Christian Member †

For my pertinent links to guides, reviews, and anything similar, go here, and look under the spoiler labeled such. A brief history of Unix and it's relation to OS X by Builder.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

I am not very proficient with Windows batch but have you tried escaping the spaces with ^ like described here?

It would be easier than renaming all the files.

Link to comment
Share on other sites

Link to post
Share on other sites

I have a batch file that overwrites all of them. 

The structure is simple. U:\ is the Users drive (to store work related documents). Every employee has a folder in that drive with their name on it. Using the * character, I just have it put 1 of the batch file in every folder and force overwrite. Deleting it completely though, that I have to do manually (looking into a simple way to do that).

Installing stuff is something I prefer not to do. Yeah, I could install Google Drive or Skydrive on it, but then I have to make an account. And ... just no.

:P I was talking more along the lines of a dropbox-type system

Console optimisations and how they will effect you | The difference between AMD cores and Intel cores | Memory Bus size and how it effects your VRAM usage |
How much vram do you actually need? | APUs and the future of processing | Projects: SO - here

Intel i7 5820l @ with Corsair H110 | 32GB DDR4 RAM @ 1600Mhz | XFX Radeon R9 290 @ 1.2Ghz | Corsair 600Q | Corsair TX650 | Probably too much corsair but meh should have had a Corsair SSD and RAM | 1.3TB HDD Space | Sennheiser HD598 | Beyerdynamic Custom One Pro | Blue Snowball

Link to comment
Share on other sites

Link to post
Share on other sites

:P I was talking more along the lines of a dropbox-type system

If the internet goes down, that will not work. The internet can be down, but our internal network would still work. 

Thought that rarely, if ever, happens. lol

I will look into it.

† Christian Member †

For my pertinent links to guides, reviews, and anything similar, go here, and look under the spoiler labeled such. A brief history of Unix and it's relation to OS X by Builder.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

If the internet goes down, that will not work. The internet can be down, but our internal network would still work. 

Thought that rarely, if ever, happens. lol

I will look into it.

that's true >_< there should really be some solution to cloud storage but locally O.o so the dynamically updating files feature mostly

Console optimisations and how they will effect you | The difference between AMD cores and Intel cores | Memory Bus size and how it effects your VRAM usage |
How much vram do you actually need? | APUs and the future of processing | Projects: SO - here

Intel i7 5820l @ with Corsair H110 | 32GB DDR4 RAM @ 1600Mhz | XFX Radeon R9 290 @ 1.2Ghz | Corsair 600Q | Corsair TX650 | Probably too much corsair but meh should have had a Corsair SSD and RAM | 1.3TB HDD Space | Sennheiser HD598 | Beyerdynamic Custom One Pro | Blue Snowball

Link to comment
Share on other sites

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×