Post Reply 
what's wrong with this fragment of windows batch code?
Author Message
justMongo Offline

Monitors

Posts: 3,855
Joined: Sep 2013

Machine: ResMed VPAP Auto (S9)
Mask Type: Full face mask
Mask Make & Model: ResMed Mirage Quattro
Humidifier: ResMed H5i
CPAP Pressure: 18 IPAPmax - 11 EPAPmin, PS=5
CPAP Software: Other Software

Other Comments: μολὼν λαβέ

Sex: Male
Location: Калифорния

Post: #11
RE: what's wrong with this fragment of windows batch code?
(05-07-2015 11:23 PM)surferdude2 Wrote:  That doesn't make any difference, either - or / should work. You just can't use the /t switch with the /l. I've never had any program squawk when using shutdown /l and letting the system handle the rest.

That I didn't know. I am syncing several machines by doing a backup of data files to my NAS using ROBOCOPY. Then using that backup and ROBOCOPY to update a machine. When the last ROBOCOPY finishes I am using TIMEOUT in the script to give it 30 seconds to make sure writes have finished. Then I need it to logout for security. So, it's working.

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
05-08-2015 10:31 AM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
Crimson Nape Offline

Monitors

Posts: 1,335
Joined: Oct 2014

Machine: ResMed S9 Autoset
Mask Type: Other
Mask Make & Model: P-10 / F&P Simplus / DreamWear
Humidifier: H5i w/Climateline
CPAP Pressure: 8 - EPR 3
CPAP Software: SleepyHead

Other Comments: CMS-50F & 50IW

Sex: Male
Location: Georgia

Post: #12
RE: what's wrong with this fragment of windows batch code?
(05-08-2015 10:31 AM)justMongo Wrote:  
(05-07-2015 11:23 PM)surferdude2 Wrote:  That doesn't make any difference, either - or / should work. You just can't use the /t switch with the /l. I've never had any program squawk when using shutdown /l and letting the system handle the rest.

That I didn't know. I am syncing several machines by doing a backup of data files to my NAS using ROBOCOPY. Then using that backup and ROBOCOPY to update a machine. When the last ROBOCOPY finishes I am using TIMEOUT in the script to give it 30 seconds to make sure writes have finished. Then I need it to logout for security. So, it's working.

In the past when I used ROBOCOPY under the task scheduler, I didn't need to be logged in for it to execute its code.

Statistics prove that people who have more birthdays live longer.
05-08-2015 12:16 PM
Find all posts by this user Post Reply Quote this message in a reply
justMongo Offline

Monitors

Posts: 3,855
Joined: Sep 2013

Machine: ResMed VPAP Auto (S9)
Mask Type: Full face mask
Mask Make & Model: ResMed Mirage Quattro
Humidifier: ResMed H5i
CPAP Pressure: 18 IPAPmax - 11 EPAPmin, PS=5
CPAP Software: Other Software

Other Comments: μολὼν λαβέ

Sex: Male
Location: Калифорния

Post: #13
RE: what's wrong with this fragment of windows batch code?
(05-08-2015 12:16 PM)sgearhart Wrote:  
(05-08-2015 10:31 AM)justMongo Wrote:  
(05-07-2015 11:23 PM)surferdude2 Wrote:  That doesn't make any difference, either - or / should work. You just can't use the /t switch with the /l. I've never had any program squawk when using shutdown /l and letting the system handle the rest.

That I didn't know. I am syncing several machines by doing a backup of data files to my NAS using ROBOCOPY. Then using that backup and ROBOCOPY to update a machine. When the last ROBOCOPY finishes I am using TIMEOUT in the script to give it 30 seconds to make sure writes have finished. Then I need it to logout for security. So, it's working.

In the past when I used ROBOCOPY under the task scheduler, I didn't need to be logged in for it to execute its code.

I'm not running on a schedule. If I were not logged in, and I had multiple users, how would ROBOCOPY know what user files I wish to move?

One line in my code is:
ROBOCOPY "\\192.168.2.103\%MNAME%\%FN%\My Documents\%XFOLD%" "%HOMEDRIVE%%HOMEPATH%\Documents\%XFOLD%" /S /E /R:0 /DCOPY:T /NP /LOG+:%ELOG%

%HOMEPATH% is a global variable that contains the username.
I also have to pass %FN% to the batch file as it is the name of the backup folder on the NAS in format DDMMMYYYY_HHMMSS

BTW -- a friend of mine showed me how to use powershell to initiate a backup to external drive:
wbAdmin start backup -backupTarget:X: -include:C: -allCritical -quiet

He then showed my how to drill down into a backup and mount the folder as a drive; then one can pluck out a file that was accidentally deleted or buggered up.

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
05-08-2015 12:52 PM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
Crimson Nape Offline

Monitors

Posts: 1,335
Joined: Oct 2014

Machine: ResMed S9 Autoset
Mask Type: Other
Mask Make & Model: P-10 / F&P Simplus / DreamWear
Humidifier: H5i w/Climateline
CPAP Pressure: 8 - EPR 3
CPAP Software: SleepyHead

Other Comments: CMS-50F & 50IW

Sex: Male
Location: Georgia

Post: #14
RE: what's wrong with this fragment of windows batch code?
(05-08-2015 12:52 PM)justMongo Wrote:  I'm not running on a schedule. If I were not logged in, and I had multiple users, how would ROBOCOPY know what user files I wish to move?

OK, I have it setup to look at several directories and update or delete the data on the NAS that was modified or deleted in the original directories since that last backup. I have it set in task scheduler to run at 3AM so it won't interfere with anything I'm doing.

Statistics prove that people who have more birthdays live longer.
05-08-2015 05:06 PM
Find all posts by this user Post Reply Quote this message in a reply
Crimson Nape Offline

Monitors

Posts: 1,335
Joined: Oct 2014

Machine: ResMed S9 Autoset
Mask Type: Other
Mask Make & Model: P-10 / F&P Simplus / DreamWear
Humidifier: H5i w/Climateline
CPAP Pressure: 8 - EPR 3
CPAP Software: SleepyHead

Other Comments: CMS-50F & 50IW

Sex: Male
Location: Georgia

Post: #15
RE: what's wrong with this fragment of windows batch code?
I realize that this thread has matured but I wanted to post an aid to ROBOCOPY.

Microsoft has a program named, Robocopy GUI 3.1.2. This program wraps all the command line functionality of Robocopy into a graphical program that allows you to save the script that you create with it. The documentation is in a ".doc" format that made reading it better than trying to read the command line version.

Statistics prove that people who have more birthdays live longer.
05-12-2015 11:04 AM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
YTN3rd Offline

New Members

Posts: 3
Joined: Sep 2015

Machine: Auto+
Mask Type: Full face mask
Mask Make & Model: unsure
Humidifier: unsure
CPAP Pressure: 15
CPAP Software: Other Software

Other Comments:

Sex: Male
Location:

Post: #16
RE: what's wrong with this fragment of windows batch code?
Does this logout based on inactivity?
Never had to deal with batch files in windows so not familiar with TIMEOUT and other things you used in there. Only used them for batch file movement.
09-16-2015 03:25 AM
Find all posts by this user Post Reply Quote this message in a reply
SaldusMiegas Offline

Advisory Members

Posts: 228
Joined: Apr 2015

Machine: ResMed AirSense 10 AutoSet
Mask Type: Nasal pillows
Mask Make & Model: P-10, F&P Simplus
Humidifier: integrated
CPAP Pressure: Rx:14, Set:Auto 8.0-15.0
CPAP Software: ResScan SleepyHead

Other Comments: Woot! P-10 pillows plus Ruby chinstrap for side-sleeping mouth breathers

Sex: Male
Location: Virginia

Post: #17
RE: what's wrong with this fragment of windows batch code?
(05-01-2015 03:40 PM)sgearhart Wrote:  Now I'm just a half an idiot.

ID5T?
09-16-2015 10:00 AM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
justMongo Offline

Monitors

Posts: 3,855
Joined: Sep 2013

Machine: ResMed VPAP Auto (S9)
Mask Type: Full face mask
Mask Make & Model: ResMed Mirage Quattro
Humidifier: ResMed H5i
CPAP Pressure: 18 IPAPmax - 11 EPAPmin, PS=5
CPAP Software: Other Software

Other Comments: μολὼν λαβέ

Sex: Male
Location: Калифорния

Post: #18
RE: what's wrong with this fragment of windows batch code?
(09-16-2015 03:25 AM)YTN3rd Wrote:  Does this logout based on inactivity?
Never had to deal with batch files in windows so not familiar with TIMEOUT and other things you used in there. Only used them for batch file movement.

I use SHUTDOWN -L at the end of the batch script to logout since I walk away from the machine when the batch script is running.

SHUTDOWN -S will do an orderly shutdown.

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
09-16-2015 10:18 AM
Find all posts by this user Post Reply Quote this message in a reply
AlanE Online

Advisory Members

Posts: 1,499
Joined: Mar 2015

Machine: ResMed AirSense 10 Autoset
Mask Type: Nasal pillows
Mask Make & Model: P10 & Mirage Liberty backup
Humidifier: Built-in
CPAP Pressure: 10-14
CPAP Software: ResScan SleepyHead

Other Comments: ʕ•ᴥ•ʔ So Long, and Thanks for All the Fish

Sex: Male
Location: Southwest Florida

Post: #19
RE: what's wrong with this fragment of windows batch code?
(09-16-2015 10:00 AM)SaldusMiegas Wrote:  
(05-01-2015 03:40 PM)sgearhart Wrote:  Now I'm just a half an idiot.

ID5T?

Dielaughing Took me 9,192,631,770 vibrations of a Cesium-133 atom in a vacuum to get that.



Using FlashAir W-03 SD card in machine. Access through wifi with FlashPAP or Sleep Master utilities.

I wanted to learn Binary so I enrolled in Binary 101. I seemed to have missed the first four courses. Big Grinnie
09-16-2015 10:46 AM
Find all posts by this user Post Reply Quote this message in a reply

Donate to Apnea Board
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Still want Windows 10 for free? AlanE 1 221 09-23-2016 07:23 PM
Last Post: AlanE
  a little help with PHP code for logins justMongo 12 413 09-19-2016 06:08 PM
Last Post: eseedhouse
  Windows 7 and 8.1 Users Crimson Nape 20 776 08-25-2016 08:10 PM
Last Post: FrankNichols
  Windows 10 - Install Heads-Up and a Vent Crimson Nape 11 442 07-24-2016 02:51 PM
Last Post: justMongo
  It's Windows update Tuesday justMongo 8 1,109 02-10-2016 07:04 PM
Last Post: AlanE
  Sysinternals Suite update (Windows) AlanE 1 380 01-12-2016 07:38 PM
Last Post: DariaVader
  Windows 10 AlanE 103 10,067 11-17-2015 12:12 PM
Last Post: AlanE

Forum Jump:

Who's Online (Complete List)